ISpSREngine::GetInputAudioFormat

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpSREngine::GetInputAudioFormat

ISpSREngine::GetInputAudioFormat gets the audio format that the SR engine supports. 

 

HRESULT GetInputAudioFormat(
   const GUID           *pguidSourceFormatId,
   const WAVEFORMATEX   *pSourceWaveFormatEx,
   GUID                 *pguidDesiredFormatId,
   WAVEFORMATEX        **ppCoMemDesiredWaveFormatEx,
);             

Parameters

pguidSourceFormatId
[in] The GUID of the audio format. SAPI determines if the engine can support this. It will either be NULL, indicating that the engine should select its preferred audio format, or it will be set to a given format that the engine determines if it can support.
pSourceWFEX
[in] Address of the WAVEFORMATEX structure containing information about the audio format SAPI is querying the engine about. This will only be set if pSourceFormatId is equal to SPDFID_WaveFormatEx.
pguidDesiredFormatId
[out] The GUID of the format that the engine can support.
ppCoMemDesiredWFEX
[out] The engine should call a WAVEFORMATEX structure with CoTaskMemAlloc to determine the format the engine supports. The address of the structure should be placed in this parameter. For non-wave formats, this parameter should be NULL.

Return values

Value Description
S_OK Function completed successfully.
FAILED (hr) Appropriate error message.

Remarks

Audio formats in SAPI are described by two parameters: a GUID, and for wave formats, a WAVEFORMATEX structure.

The first two parameters in this method define the audio format that SAPI queries the engine about. If these parameters are set to a specific format, the engine determines if it can support this format, and returns that format or the nearest format that the engine can support using the second pair of parameters to this function. Alternatively, if the first two parameters are NULL, the engine should return its preferred audio format in the second pair of parameters.