Share via


SPBindToFile (Windows CE 5.0)

Send Feedback

This function binds the audio stream to the specified file.

inline HRESULT SPBindToFile(LPCWSTR pFileName,SPFILEMODE eMode,ISpStream** ppStream,const GUID* pFormatId = NULL,const WAVEFORMATEX* pWaveFormatEx = NULL,ULONGLONG* ullEventInterest = SPFEI_ALL_EVENTS);

Parameters

  • pFileName
    [in] Pointer to a null-terminated string specifying the name of the file to which the stream is bound.
  • eMode
    [in] File opening mode. Possible values are defined for the SPFILEMODE enumeration. When the caller is opening an audio wave file, this value must be SPFM_OPEN_READONLY or SPFM_CREATE_ALWAYS. Otherwise, the call will fail.
  • ppStream
    [in, out] Address of a pointer to an object implementing ISpStream. On input, this object represents the audio stream to bind to the file. On output, If the function succeeds, this parameter indicates the bound stream object.
  • pFormatId
    [in] Pointer to the data format identifier associated with the stream. If the identifier is NULL (default) and the supplied file has the ".wav" extension, the format will be determined from the supplied wave file. If the identifier is NULL (default) and the file is not a wave file, the function assumes a text file.
  • pWaveFormatEx
    [in] Pointer to a valid WAVEFORMATEX structure containing wave file format information if pFormatId specifies SPDFID_WaveFormatEx (wave file). For other formats, this parameter should be set to NULL.
  • ullEventInterest
    [in] Pointer to flags for the events of interest. The default is flags retrieved by the SPFEI_ALL_EVENTS macro. See the Remarks section for the SPFEI macro.

Return Values

The following table shows the possible return values.

Value Description
S_OK Function completed successfully.
E_INVALIDARG One or more arguments are invalid.
SPERR_ALREADY_INITIALIZED The object has already been initialized.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Sphelper.h.
Link Library: Sapilib.lib.

See Also

SAPI Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.