Share via


Note

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

Microsoft Speech Platform

ISpRecognizer::GetFormat

ISpRecognizer::GetFormat retrieves the current input audio format.

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

Parameters

  • WaveFormatType
    [in] One of the wave file format types specified in SPSTREAMFORMATTYPE.
  • pFormatId
    [out] The address of the unique identifier associated with the format type.
  • ppCoMemWFEX
    [out] Address of a pointer to a WAVEFORMATEX structure that receives the format information. This is set only if the input is of a wave format type. The application must free this data with CoTaskMemFree after use.

Return Values

Value Description
S_OK Function completed successfully.
E_POINTER Invalid pointer.
SPERR_UNINITIALIZED Audio input not yet set.
FAILED(hr) Appropriate error message.

Remarks

This method can return either the input format or the engine format. Normally these two values will be the same, but if the Speech Platform is using a format converter to convert the input data from the audio input to the engine format, these will be different.