TextToSpeechReturnBuffer

The TextToSpeechReturnBuffer call returns the current buffer when an application is using the speech-to-memory capability. The buffer can be empty or partially full when it is returned. The dwBufferLength element of the TTS_BUFFER_T structure contains the number of samples in the buffer. If no buffer is available, then a NULL pointer is returned in ppTTSbuffer.

Syntax

MMRESULT TextToSpeechReturnBuffer

(LPTTS_HANDLE_T phTTS,
LPTTS_BUFFER_T *ppTTSbuffer)

Parameters

LPTTS_HANDLE_T phTTS

Specifies a text-to-speech handle.

LPTTS_BUFFER_T *ppTTSbuffer

Points to a structure containing the memory buffers. Buffers were supplied by the application to be used while in speech-to-memory mode.

Return Value

This call returns a value of type MMRESULT. The return value is zero if the call is successful. The return value is one of the following constants:

Constant

Description

MMSYSERR_NOERROR

Normal successful completion (zero).

MMSYSERR_INVALPARAM

Invalid parameter.

MMSYSERR_ERROR

Output to memory not enabled or unable to create a system object.

MMSYSERR_INVALHANDLE

The text-to-speech handle was invalid.

 

 

Comments

Most applications do not require this call because buffers are automatically returned when filled or when a TTS_FORCE flag is passed in the TextToSpeechSpeak() call. The TextToSpeechReturnBuffer call is provided so an application can return a buffer before it is filled and, therefore, obtain more speech samples immediately.

TextToSpeechAddBuffer must be called before calling TextToSpeechReturnBuffer.

See Also

btn_mini.gif TextToSpeechAddBuffer