ISRResAudio::GetWAV

HRESULT GetWAV(PSDATA pWav);

Retrieves an audio recording of an utterance in waveform-audio (.wav) file format.

· Returns NOERROR if successful, or one of these error values:

E_INVALIDARG
E_OUTOFMEMORY
SRERR_NOTENOUGHDATA

pWav

[out] Address of an SDATA structure that receives audio data for the recognition. The dwSize member receives the amount of memory and file size needed to store the audio data. The pData member receives the address of a memory object that contains the file format.

The application allocates the SDATA structure and passes its address to the GetWAV member function. GetWAV allocates memory (using the OLE task allocator) for the returned data and sets the pData member of SDATA to point to the memory. If the allocation fails, the pData member is set to NULL and the dwSize member is set to zero. The application must free the memory pointed to by pData, as well as the SDATA structure itself.

If the engine has maintained an audio recording of the utterance, it packages the audio into waveform-audio file format. The application can then save the audio to a file or use the SndPlaySound function to play it back. If no digital-audio information is stored, this returns an error.

The application must free the memory allocated by the member function, by using the CoTaskMemAlloc and CoTaskMemFree functions.

For more information about the WAV file format, see the Microsoft Win32 Software Development Kit (SDK).