Share via


Note

Please see Azure Cognitive Services for Speech documentation for the latest supported speech solutions.

Microsoft Speech Platform

ISpAudio::GetDefaultFormat

ISpAudio::GetDefaultFormat passes back the default audio format.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT GetDefaultFormat(</strong> <strong>GUID</strong> *<em>pFormatId</em>, <a runat="server" href="jj127893(v=msdn.10).md"><strong>WAVEFORMATEX</strong></a> **<em>ppCoMemWaveFormatEx</em> <strong>);</strong> </pre>

Parameters

  • pFormatId
    [out] Pointer to the GUID of the default format.
  • ppCoMemWaveFormatEx
    [out] Address of a pointer to the WAVEFORMATEX structure that receives the wave file format information. The Speech Platform allocates the memory for the WAVEFORMATEX data structure using CoTaskMemAlloc, but it is the caller's responsibility to call CoTaskMemFree on the returned WAVEFORMATEX pointer.

Return Values

Value Description
S_OK Function completed successfully.
SPERR_UNINITIALIZED Stream is uninitialized.
E_POINTER pFormatId is invalid.

Remarks

Other formats may be supported by the audio device; however, this format is guaranteed to work. Older sound cards can potentially fail when attempting to use this format if they are not fully duplex or do not support full duplex operation at different frequencies. An application should attempt to degrade gracefully when this occurs.