Share via


Note

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

Microsoft Speech Platform

ISpStreamFormatConverter::SetFormat

ISpStreamFormatConverter::SetFormat sets the output format of the converter. 

The ISpStreamFormat::GetFormat method returns the format of the output (converted) stream.

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>HRESULT SetFormat(</strong> <strong> REFGUID</strong> <em>rguidFormatIdOfConvertedStream</em>, <strong> const</strong> <a runat="server" href="jj127893(v=msdn.10).md"><strong>WAVEFORMATEX</strong></a> *<em>pWaveFormatExOfConvertedStream</em> <strong>);</strong> </pre>

Parameters

  • rguidFormatIdOfConvertedStream
    [in] Address of the data format identifier associated with the requested output stream. Can be GUID_NULL or SPDFID_WaveFormatEx.
  • pWaveFormatExOfConvertedStream
    [in] Address of the WAVEFORMATEX structure containing the WAV file format information of the converted stream. Must be NULL with GUID_NULL. Must be a valid WAVEFORMATEX with SPDFID_WaveFormatEx.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One of the following was encountered:

rguidFormatIdOfConvertedStream is neither GUID_NULL or SPDFID_WaveFormatEx;

pWaveFormatExOfConvertedStream is not valid for the supplied REFGUID.

Remarks

You can use the helper class CSpStreamFormat and the SPSTREAMFORMAT enumeration to reduce the possibility of typos or mistakes when filling in the WAVEFORMATEX structure.