Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions VAD/VAD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* Begin PBXBuildFile section */
58C0C98F1BCFB266007D4002 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 58C0C98E1BCFB266007D4002 /* main.c */; };
58C0C99A1BCFB2A4007D4002 /* VAD.c in Sources */ = {isa = PBXBuildFile; fileRef = 58C0C9981BCFB2A4007D4002 /* VAD.c */; };
58C0C99A1BCFB2A4007D4002 /* VADContext.c in Sources */ = {isa = PBXBuildFile; fileRef = 58C0C9981BCFB2A4007D4002 /* VADContext.c */; };
CEFA6EE41C17DC330099E66B /* count-hammer.raw in Copy 16bit_PCM_big_endian_16000_mono Sounds */ = {isa = PBXBuildFile; fileRef = CEB5E0151C17D383000B5E65 /* count-hammer.raw */; };
CEFA6EE51C17DC330099E66B /* count.raw in Copy 16bit_PCM_big_endian_16000_mono Sounds */ = {isa = PBXBuildFile; fileRef = CEB5E0161C17D383000B5E65 /* count.raw */; };
CEFA6EE61C17DC330099E66B /* count1.raw in Copy 16bit_PCM_big_endian_16000_mono Sounds */ = {isa = PBXBuildFile; fileRef = CEB5E0171C17D383000B5E65 /* count1.raw */; };
Expand Down Expand Up @@ -66,8 +66,8 @@
/* Begin PBXFileReference section */
58C0C98B1BCFB266007D4002 /* VAD */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = VAD; sourceTree = BUILT_PRODUCTS_DIR; };
58C0C98E1BCFB266007D4002 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
58C0C9981BCFB2A4007D4002 /* VAD.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VAD.c; sourceTree = "<group>"; };
58C0C9991BCFB2A4007D4002 /* VAD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VAD.h; sourceTree = "<group>"; };
58C0C9981BCFB2A4007D4002 /* VADContext.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VADContext.c; sourceTree = "<group>"; };
58C0C9991BCFB2A4007D4002 /* VADContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VADContext.h; sourceTree = "<group>"; };
CEB5E0151C17D383000B5E65 /* count-hammer.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = "count-hammer.raw"; sourceTree = "<group>"; };
CEB5E0161C17D383000B5E65 /* count.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = count.raw; sourceTree = "<group>"; };
CEB5E0171C17D383000B5E65 /* count1.raw */ = {isa = PBXFileReference; lastKnownFileType = file; path = count1.raw; sourceTree = "<group>"; };
Expand All @@ -91,6 +91,8 @@
CEB5E02B1C17D383000B5E65 /* z03.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = z03.wav; sourceTree = "<group>"; };
CEFA6EF31C17DD930099E66B /* VADCheck.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VADCheck.c; sourceTree = "<group>"; };
CEFA6EF41C17DD930099E66B /* VADCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VADCheck.h; sourceTree = "<group>"; };
CEFA6EF61C181DB10099E66B /* VADState.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VADState.h; sourceTree = "<group>"; };
CEFA6EF71C181ED30099E66B /* VAD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VAD.h; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -133,8 +135,10 @@
58C0C9971BCFB292007D4002 /* VAD */ = {
isa = PBXGroup;
children = (
58C0C9981BCFB2A4007D4002 /* VAD.c */,
58C0C9991BCFB2A4007D4002 /* VAD.h */,
58C0C9981BCFB2A4007D4002 /* VADContext.c */,
58C0C9991BCFB2A4007D4002 /* VADContext.h */,
CEFA6EF61C181DB10099E66B /* VADState.h */,
CEFA6EF71C181ED30099E66B /* VAD.h */,
);
path = VAD;
sourceTree = "<group>";
Expand Down Expand Up @@ -260,7 +264,7 @@
files = (
CEFA6EF51C17DD930099E66B /* VADCheck.c in Sources */,
58C0C98F1BCFB266007D4002 /* main.c in Sources */,
58C0C99A1BCFB2A4007D4002 /* VAD.c in Sources */,
58C0C99A1BCFB2A4007D4002 /* VADContext.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
28 changes: 5 additions & 23 deletions VAD/VAD/VAD/VAD.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,11 @@
// VAD.h
// VAD
//
// Created by Kuragin Dmitriy on 15/10/15.
// Copyright © 2015 Kuragin Dmitriy. All rights reserved.
//

#ifndef VAD_h
#define VAD_h

#include <stdio.h>

typedef enum {
VADStateError = -2,
VADStateUnknown = -1,
VADStateInProgress = 1,
VADStateEndOfSpeech = 2,
VADStateNoSpeech = 3
} VADState;

typedef struct VADContext *VADContextRef;

VADContextRef VADContextCreate();
void VADContextRelease(VADContextRef context);
#ifndef VAD_H
#define VAD_H

VADState VADContextAnalyseFrames(const VADContextRef context, const short *frames, size_t frames_count);
void VADContextReset(const VADContextRef context);
#include "VADContext.h"
#include "VADState.h"

#endif /* VAD_h */
#endif /* VAD_H */
4 changes: 2 additions & 2 deletions VAD/VAD/VAD/VAD.c → VAD/VAD/VAD/VADContext.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// VAD.c
// VADContext.c
// VAD
//
// Created by Kuragin Dmitriy on 15/10/15.
// Copyright © 2015 Kuragin Dmitriy. All rights reserved.
//

#include "VAD.h"
#include "VADContext.h"

#include <stdlib.h>
#include <string.h>
Expand Down
32 changes: 32 additions & 0 deletions VAD/VAD/VAD/VADContext.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// VADContext.h
// VAD
//
// Created by Kuragin Dmitriy on 15/10/15.
// Copyright © 2015 Kuragin Dmitriy. All rights reserved.
//

#ifndef VAD_CONTEXT_H
#define VAD_CONTEXT_H

#include <stdio.h>

#include "VADState.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct VADContext *VADContextRef;

VADContextRef VADContextCreate();
void VADContextRelease(VADContextRef context);

VADState VADContextAnalyseFrames(const VADContextRef context, const short *frames, size_t frames_count);
void VADContextReset(const VADContextRef context);

#ifdef __cplusplus
}
#endif

#endif /* VAD_CONTEXT_H */
17 changes: 17 additions & 0 deletions VAD/VAD/VAD/VADState.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// VADState.h
// VAD
//

#ifndef VAD_STATE_H
#define VAD_STATE_H

typedef enum {
VADStateError = -2,
VADStateUnknown = -1,
VADStateInProgress = 1,
VADStateEndOfSpeech = 2,
VADStateNoSpeech = 3
} VADState;

#endif /* VAD_STATE_H */
1 change: 0 additions & 1 deletion VAD/VAD/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <stdio.h>

#include "VAD.h"
#include "VADCheck.h"

int main(int argc, const char * argv[]) {
Expand Down
1 change: 1 addition & 0 deletions VAD/VAD/tests/VADCheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <unistd.h>

#include "VADCheck.h"
#include "VADContext.h"

static const char *const VADSubpath_16bit_PCM_big_endian_16000_mono =
"/16bit_PCM_big_endian_16000_mono/";
Expand Down
3 changes: 2 additions & 1 deletion VAD/VAD/tests/VADCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#define VADCheck_h

#include <stdio.h>
#include "VAD.h"

#include "VADState.h"

typedef enum {
AudioFileEncoding_16bit_PCM_big_endian_16000_mono = 0,
Expand Down