You are reading help file online using chmlib.com
|
ISpRecoContext::GetAudioOptions retrieves the audio options for the context.
HRESULT GetAudioOptions(
SPAUDIOOPTIONS *Options,
GUID *pAudioFormatId,
WAVEFORMATEX **ppCoMemWFE
);
Value | Meaning |
---|---|
SPAO_NONE | Do not retain audio for results. |
SPAO_RETAIN_AUDIO | Retain audio for all future results. |
Value | Description |
---|---|
S_OK | Function completed successfully. |
E_POINTER | One of the pointers is invalid or bad. |
FAILED(hr) | Appropriate error message. |
The default audio options are none (i.e., SPAO_NONE). The default retained audio format is the speech recognition engine's recognition format (see ISpRecognizer::GetFormat with SPWF_SRENGINE).
See also ISpRecoContext::SetAudioOptions.
The following code snippet illustrates the use of ISpRecoContext::GetAudioOptions and querying the different retained audio settings.
HRESULT hr = S_OK;
// check if audio is being retained (default is NO)
hr = cpRecoContext->GetAudioOptions(&pAudioOptions, NULL, NULL);
// Check hr
// check what audio format would be retained
hr = cpRecoContext->GetAudioOptions(NULL, &guidFormat, &pWaveFormatEx);
// Check hr
// ... do stuff
// free the wave format memory
::CoTaskMemFree(pWaveFormatEx);
// check if audio is being retained, and if so what the format is
hr = cpRecoContext->GetAudioOptions(&guid, &guidFormat, &pWaveFormatEx);
// Check hr
// ... do stuff
// free the wave format memory
::CoTaskMemFree(pWaveFormatEx);
Helper Enumerations and Functions | Description |
---|---|
SPSTREAMFORMAT | SAPI supported stream formats |
CSpStreamFormat | Class for managing SAPI supported stream formats and WAVEFORMATEX structures |
You are reading help file online using chmlib.com
|