ISpMMSysAudio::Write

Microsoft Speech SDK

The Microsoft.com Speech website Microsoft Speech SDK SAPI 5.1

ISpMMSysAudio::Write

ISpMMSysAudio::Write writes data to the multimedia audio device.

The audio device should not be directly manipulated when performing speech recognition (see ISpRecognizer).


HRESULT Write(
   const void  *pv,
   ULONG        cb,
   ULONG       *pcbWritten 
);

Parameters

pv
[in] Pointer to the buffer containing the data that is to be written to the audio device. A valid pointer must be provided for this parameter even when cb is zero.
cb
[in] The number of bytes of data to attempt to write to the audio device. This value may be zero.
pcbWritten
[out] Pointer to a ULONG variable where this method writes the actual number of bytes written to the audio device. If set to NULL, no byte value is passed back.

Return values

Value Description
S_OK Function completed successfully.
SPERR_AUDIO_STOPPED Multimedia device has been stopped.
E_OUTOFMEMORY Exceeded available memory.
E_POINTER At least one of pcbWritten or pv are invalid or bad.
STG_E_ACCESSDENIED Multimedia device is write-only and no bytes will be written. Error will occur when writing to an input device.
FAILED (hr) Appropriate error message.