SpeechRecoContext RetainedAudioFormat Property

Microsoft Speech SDK

Intelligent Interface Technologies Home Page Microsoft Speech SDK

Speech Automation 5.1

Interface: ISpeechRecoContext

RetainedAudioFormat Property


The RetainedAudioFormat property gets and sets the format of audio retained by the recognition context.

By default, the retained audio format will be the same as the input audio format. The input audio format is retrieved by calling Recognizer.GetFormat with SFTInput as the parameter. The audio format may be set, or reset if the format has previously changed, to the same format as the engine uses by passing Nothing in as the parameter.


Syntax

Set: SpeechRecoContext.RetainedAudioFormat = SpAudioFormat
Get: SpAudioFormat = SpeechRecoContext.RetainedAudioFormat

Parts

SpeechRecoContext
The owning object.
SpAudioFormat
Set: An SpAudioFormat object that sets the audio format.
Get: An SpAudioFormat object that returns the audio format.

Remarks

The recognition context's RetainedAudio need not be set to SRAORetainAudio for RetainedAudioFormat to be called successfully. RetainedAudioFormat indicates the format in which the audio would be retained, regardless of whether it is currently retained.

Example

The following snippet demonstrates retrieving the audio format of the audio input stream, through the RetainedAudioFormat reference.

Set RC = New SpSharedRecoContext

Dim audioFormat As SpAudioFormat
Set audioFormat = RC.RetainedAudioFormat