SpeechRecoContext AllowVoiceFormatMatchingOnNextSet Property

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechRecoContext
Type: Hidden

AllowVoiceFormatMatchingOnNextSet Property


The AllowVoiceFormatMatchingOnNextSet property determines if the recognition context can change the audio format of the output voice to match the audio format of the input stream.

AllowVoiceFormatMatchingOnNextSet can be used only if a voice has been created through the recognition context. If this property is set to True, the voice's output format will be set to the same format as the associated SR engine's audio input format. This conversion takes place only during the next setting of the SpVoice.Voice. However, if this voice object has already been bound to a stream which has specific format, the voice's format will not be changed to the SR engine's audio input format even if set to True. If False, the conversion is not made.

Using the same audio format for input and output source is useful for sound cards that do not support full-duplex audio (i.e., input format must match output format). If the input format quality is lower than the output format quality, the output format quality will be reduced to equal the input quality.

By default, AllowVoiceFormatMatchingOnNextSet is set to True.


Syntax

Set: ISpeechRecoContext.AllowVoiceFormatMatchingOnNextSet = Boolean
Get: Boolean = ISpeechRecoContext.AllowVoiceFormatMatchingOnNextSet

Parts

SpeechRecoContext
The owning object.
Boolean
Set: A Boolean variable that sets the property.
Get: A Boolean variable that gets the property.

Example

The following snippet demonstrates retrieving and setting AllowVoiceFormatMatchingOnNextSet.

Public WithEvents RecognitionContext As SpSharedRecoContext
Set RecognitionContext = New SpSharedRecoContext
    
Dim voiceChange As Boolean
voiceChange = RecognitionContext.AllowVoiceFormatMatchingOnNextSet

RecognitionContext.AllowVoiceFormatMatchingOnNextSet = True
voiceChange = RecognitionContext.AllowVoiceFormatMatchingOnNextSet