You are reading help file online using chmlib.com
|
Object: ISpeechRecoResult
The AudioFormat property gets or sets the audio stream format.
The controlling recognition context must retain the audio portion of the recognition. By default, a recognition context does not retain audio; that is, RecoContext.RetainedAudio is set to SRAONone. Attempts to access this retained audio stream, including references to AudioFormat, cause an SPERR_NO_AUDIO_DATA error. To retain the audio, use ISpeechRecoContext.RetainedAudio passing SRAORetainAudio as the parameter.
Get: | SpAudioFormat = ISpeechRecoResult.AudioFormat |
Set: | ISpeechRecoResult.AudioFormat = SpAudioFormat |
The following code snippet demonstrates retrieving and setting the audio format.
The following code snippets assume a valid RecoResult. The following code demonstrates setting the recognition context.
Set RC = New SpSharedRecoContext
RC.RetainedAudio = SRAORetainAudio
'Get audio format
Dim GetFormat as SpAudioFormat
Set Format = RecoResult.AudioFormat
'Set audio format
Dim SetFormat as SpAudioFormat
Set SetFormat = CreateObject("SAPI.SpAudioFormat")
SetFormat.Type = SAFT11kHz16BitMono
Set RecoResult.AudioFormat = SetFormat
You are reading help file online using chmlib.com
|