TextToSpeechSpeak(3dtk)

Name

TextToSpeechSpeak - Queues a null-terminated string to the text-to-speech system.

Syntax
    MMRESULT TextToSpeechSpeak (LPTTS_HANDLE_T phTTS,
                               LPSTR pszTextString,
                               DWORD dwFlags)

Parameters

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

LPSTR pszTextString
    Specifies a pointer to a null-terminated string of characters to be queued.

DWORD dwFlags
    Specifies whether the text is to be pushed through the text-to-speech system even if it does NOT end on a clause boundary. The parameter can be set to one of the following constants defined in include file ttsapi.h:

Constants | Description
TTS_NORMAL
 | Insert characters in the text-to-speech queue.
TTS_FORCE
 | Insert characters in the text-to-speech queue and force all text to be output, even if the text stream does NOT end on a clause boundary.

Description

This function queues a null-terminated string to the text-to-speech system.

While the text-to-speech system is in the startup state, speech samples are routed to the audio device or ignored, depending on whether the startup function flag DO_NOT_USE_AUDIO_DEVICE is clear or set in the dwDeviceOptions parameter of the startup function.

If the text-to-speech system is in a special mode (wave-file, log-file, or speech-to-memory modes), the speech samples are handled as the mode dictates.

The speaker, speaking rate, and volume can be changed in the text string by inserting voice-control commands, as shown in the following example:

[:name paul] I am Paul. [:nb] I am Betty. [:volume set 50] The volume has been set to 50% of the maximum level. [:rate 120] I am speaking at 120 words per minute.

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_NOMEM
 | Unable to allocate memory.
MMSYSERR_INVALHANDLE
 | The text-to-speech handle was invalid.

See Also

Special Text-To-Speech Modes (DECtalk Software Programmer's Guide)

TextToSpeechOpenInMemory(3dtk), TextToSpeechOpenLogFile(3dtk), TextToSpeechOpenWaveOutFile(3dtk), TextToSpeechStartup(3dtk), TextToSpeechStartupEx(3dtk)