TextToSpeechOpenInMemory(3dtk)

Name

TextToSpeechOpenInMemory - Initiates speech-to-memory mode, allowing speech to be stored in memory buffers supplied by the application.

Syntax
    MMRESULT TextToSpeechOpenInMemory (LPTTS_HANDLE_T phTTS,
                                      DWORD dwFormat)

Parameters

LPTTS_HANDLE_T phTTS
    Specifies an opened text-to-speech handle.

DWORD dwFormat
    Specifies an identifier that determines the audio sample format. It is one of the following constants defined in the include files mmsystem.h and ttsapi.h:

Constant | Description
WAVE_FORMAT_1M08
 | Mono, 8-bit 11.025 kHz sample rate
WAVE_FORMAT_1M16
 | Mono, 16-bit 11.025 kHz sample rate
WAVE_FORMAT_08M08
 | Mono, 8-bit mu-law 8 kHz sample rate

Description

This function causes the text-to-speech system to enter the speech-to-memory mode, in which speech samples are written into memory buffers rather than sent to an audio device each time TextToSpeechSpeak() is called. TextToSpeechAddBuffer() supplies the text-to-speech system with the memory buffers it needs. The text-to-speech system remains in speech-to-memory mode until TextToSpeechCloseInMemory() is called.

The memory buffer is passed using the structure TTS_BUFFER_T. The user must allocate the structure and its associated elements (memory buffer, phoneme array, and index mark array). Refer to the DECtalk Software Programmer's Guide, Speech-To-Memory Mode section for more information on the TTS_BUFFER_T structure and its elements.

The text-to-speech system returns the buffer to the application when the memory buffer, phoneme array, or index mark array is full or when a TTS_FORCE was used in a TextToSpeechSpeak() call. Refer to the DECtalk Software Progammer's Guide, Callback Routines and Window Procedures section for details on passing information back to the calling application.

The startup function must be called to start the text-to-speech system before calling TextToSpeechOpenInMemory().

TextToSpeechOpenInMemory() automatically resumes audio ouput if the text-to-speech system is in a paused state due to a previous TextToSpeechPause() call.

Return Values

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

Constant | Description
MMSYSERR_NOERROR
 | Normal successful completion (zero).
MMSYSERR_INVALPARAM
 | An invalid parameter or illegal wave output format was passed.
MMSYSERR_NOMEM
 | Unable to allocate memory.
MMSYSERR_ERROR
 | Illegal output state.
MMSYSERR_INVALHANDLE
 | The text-to-speech handle was invalid.

See Also

Callback Routines and Window Procedures (DECtalk Software Programmer's Guide)

Speech-to-Memory Mode (DECtalk Software Programmer's Guide)

TextToSpeechAddBuffer(3dtk), TextToSpeechCloseInMemory(3dtk), TextToSpeechPause(3dtk), TextToSpeechReset(3dtk), TextToSpeechReturnBuffer(3dtk), TextToSpeechSpeak(3dtk), TextToSpeechStartup(3dtk), TextToSpeechStartupEx(3dtk)