Last reviewed: 8/1/2001
Article ID: H080101
HOW: Passing an audio buffer for recognition
The information in this article applies to:
- SpeechKit 3
SpeechKit 3 offers you a way to pass audio to the recognizer via a buffer rather than a wave file, IStream, or live microphone. So if your audio feed is from another component or subsystem in memory buffers, you can easily pass these buffers to the recognizer using the Record (StartRecording) method.
To pass an audio buffer via the Record method, you must first set the AudioFormat property to the format of the buffered audio. Then pass the buffer pointer using the Record method. For example:
ChantSR.AudioFormat = AF8kHz8BitMono ChantSR.Record (pBuffer,dwBufferSize,WaveBufferRecording,RecordingAsynchronous);
If no vocabularies are active when you invoke the Record method, it will automatically add and enable a dictation vocabulary. If at least one vocabulary is active, it will not automatically add an enable a dictation vocabulary. You will need to add and enable a dictation vocabulary if needed.