Share via


Note

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

Microsoft Speech Platform

SPBindToFile

SPBindToFile binds the audio stream to the specified file.

Found in: sphelper.h

<pre IsFakePre="true" xmlns="http://www.w3.org/1999/xhtml"> <strong>SPBindToFile(</strong> <strong> LPCWSTR</strong> <em>pFileName</em>, <strong> <a runat="server" href="jj127464(v=msdn.10).md">SPFILEMODE</a></strong> <em>eMode</em>, <strong> <a runat="server" href="jj127806(v=msdn.10).md">ISpStream</a></strong> **<em>ppStream</em>, <strong> const GUID</strong> *<em>pFormatId = NULL</em>, <strong> const <a runat="server" href="jj127893(v=msdn.10).md">WAVEFORMATEX</a></strong> *<em>pWaveFormatEx</em> = NULL, <strong> ULONGLONG</strong> *<em>ullEventInterest</em> = SPFEI_ALL_EVENTS <strong>);</strong> </pre>

Parameters

  • pFileName
    [in] Address of a null-terminated string containing the file name of the file to bind the stream to.
  • eMode
    [in] Flag of the type SPFILEMODE to define the file opening mode. When opening an audio wave file, this must be SPFM_OPEN_READONLY or SPFM_CREATE_ALWAYS, otherwise the call will fail.
  • ppStream
    [in, out] The address of an ISpStream pointer. If the function succeeds, this value is filled in with the newly created ISpStream interface.
  • pFormatId
    [in] The data format identifier associated with the stream. This can be NULL (default) and the format will be determined from the supplied wave file, if the file has the '.wav' extension. If it doesn't, the file is assumed to be a text file.
  • pWaveFormatEx
    [in] Address of the WAVEFORMATEX structure that contains the wave file format information. If guidFormatId is SPDFID_WaveFormatEx, this must point to a valid WAVEFORMATEX structure. For other formats, it should be NULL.
  • ullEventInterest
    [in] Flags of type SPEVENTENUM for the events wanted.

Return Values

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more parameters are invalid.
SPERR_ALREADY_INITIALIZED The object has already been initialized.
SPERR_INVALID_WAV_FILE The .WAV file is impropertly formatted.