Browse
 
Tools
Rss Categories

Example Code

1 A Working Example In C

Included in this documentation is a working example that incorporates streaming audio, SRGS grammars, and SemanticInterpretation.It is written in C, is based on examples throughout this documentation, and compiles under Visual Studio 2013, although should…

2 A Working Example In C++

Included in this documentation is a working example that incorporates streaming audio, SRGS grammars, and Semantic Interpretation. It is written in C++, is based on examples throughout this documentation, and compiles under Visual Studio 2013, although should…

3 audioStreamer.cpp

C++ Code #include "AudioStreamer.h" #include <stdio.h> #include <fcntl.h> #include <io.h> //============================================================================= AudioStreamer :: AudioStreamer ( const char * filename ) : increment_ms…

4 audioStreamer.h

C++ Code #include "HeaderClasses.h" #ifndef AUDIO_STREAMER_H #define AUDIO_STREAMER_H typedef bool ( * AudioStreamCB ) ( char * audio_chunk, int chunk_size, void * user_data ) ; /** class AudioStreamer Mimics live audio being streamed. It reads audio a bit…

5 headerClasses.h

C++ Code #ifndef HEADER_ONLY_HELPER_CLASSES_DEFINED #define HEADER_ONLY_HELPER_CLASSES_DEFINED #include <string> #include <process.h> #include <time.h> #include <sys/types.h> #include <sys/timeb.h> #include <Windows.h>…

6 Main.cpp

C++ Code #include "AudioStreamer.h" #include "SimpleRecognizer.h" #include <iostream> int main ( ) { SimpleRecognizer Reco; Reco. LoadGrammar ( "yesno" , "builtin:grammar/boolean" ) ; AudioStreamer Audio ( "1234.ulaw" ) ; Reco. Recognize ( & Audio,…

7 SimpleRecognizer.cpp

C++ Code #include "SimpleRecognizer.h" #include <sstream> //============================================================================= // Callback for messages from the speech port void logger ( const char * msg, void * userdata ) { std :: cout <<…

8 SimpleRecognizer.h

C++ Code #ifndef SIMPLE_RECOGNIZER_H #define SIMPLE_RECOGNIZER_H #include "AudioStreamer.h" #include <LVSpeechPort.h> class SimpleRecognizer { public : SimpleRecognizer ( ) ; ~SimpleRecognizer ( ) ; void WaitUntilDone ( ) ; void LoadGrammar ( const…