TextToSpeechStartup(3dtk)

Name

TextToSpeechStartup - Initializes the text-to-speech system.

Syntax
    MMRESULT TextToSpeechStartup (LPTTS_HANDLE_T *phtTTS,
                                 UINT uiDeviceNumber,
                                 DWORD dwDeviceOptions,
                                 VOID (*DtCallbackRoutine)(),
                                 LONG dwCallbackParameter)

Parameters

LPTTS_HANDLE_T *phTTS
    Specifies a pointer to a pointer to a text-to-speech handle.

UINT uiDeviceNumber
    Specifies the device number of the wave output device. A value of WAVE_MAPPER can be used to select the first available device.

DWORD dwDeviceOptions
    Specifies how the wave output device is managed. It can be a combination of the device-option constants OWN_AUDIO_DEVICE, REPORT_OPEN_ERROR, and DO_NOT_USE_AUDIO_DEVICE, which are defined in the include file ttsapi.h and described below.

VOID *(DtCallbackRoutine)()
    Specifies a callback routine, which is used by DECtalk Software to inform the application when the buffer is full (if DECtalk Software in-memory calls are being used) or when the TextToSpeechSpeak() function encounters an index mark. Refer to the DECtalk Software Programmer's Guide, Callback Routines and Window Procedures section for information about the argument list for the callback routine. A value of NULL should be passed if no callback routine is desired.

LONG dwCallbackParameter
    Specifies a pointer to a user-specified parameter. This is used to pass parameters into the callback routine. A value of NULL should be passed if no user-specified parameters are desired.

Device-Option Constant | Description
OWN_AUDIO_DEVICE
 | The wave output device is opened. No other process can allocate the wave output device until TextToSpeechShutdown() is called. IF OWN_AUDIO_DEVICE is NOT specified, the wave output device is opened after audio is queued by the TextToSpeechSpeak() function. The wave output device is released when the text-to-speech system has completed speaking.
REPORT_OPEN_ERROR
 | If an attempt is made to open the wave output device while another process owns it, a callback is made to the callback routine that was specified in the DtCallbackRoutine parameter.
DO_NOT_USE_AUDIO_DEVICE
 | When this flag is set, speech samples are ignored until one of the text-to-speech special modes (log-file, wave-file, or speech-to-memory) is set. The special modes can be used to write the speech samples to log files, wave files, or memory buffers. No error is returned if a wave output device is not present.

Description

This function initializes the text-to-speech system; defines the callback routine; checks for valid licenses; and loads the main and user pronunciation dictionaries.

A single process can run multiple instances of DECtalk.

If a callback routine is defined, DECtalk Software will alert the calling application when a buffer is filled while in speech-to-memory mode, when an error occurs, or when an index mark is encountered.

The default parameters are:

•   Language: American English

•   Speaking rate: 200 words per minute

•   Speaker: Paul

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_NODRIVER
 | No wave output device present.
MMSYSERR_NOMEM
 | Memory allocation error.
MMSYSERR_ERROR
 | DECtalk dictionary not found.
MMSYSERR_BADDEVICE_ID
 | Device ID out of range.
MMSYSERR_ALLOCATED
 | License exists but no more units available.
MMSYSERR_NOTENABLED
 | License does not exist.
WAVERR_BADFORMAT
 | Wave output device does not support the request format.

See Also

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

Dictonary Functions (Linux and UNIX) (DECtalk Software Programmer's Guide)

TextToSpeechLoadUserDictionary(3dtk), TextToSpeechOpenInMemory(3dtk), TextToSpeechOpenLogFile(3dtk), TextToSpeechOpenWaveOutFile(3dtk), TextToSpeechShutdown(3dtk), TextToSpeechSpeak(3dtk), TextToSpeechStartupEx(3dtk), TextToSpeechUnloadUserDictionary(3dtk)