# TextToSpeechOpenLogFile

The TextToSpeechOpenLogFile call causes the specified log file to be opened and the text-to-speech sytem to enter into the log-file mode. This mode indicates that the speech samples are to be written as text, phonemes, or syllables into the log file each time TextToSpeechSpeak is called. The phonemes and syllables are written using the arpabet alphabet. The text-to-speech system remains in the log-file mode until TextToSpeechCloseLogFile is called.

Syntax | MMRESULT TextToSpeechOpenLogFile | (LPTTS_HANDLE_T phTTS, LPSTR pszFileName, DWORD dwFlags)
Parameters | LPTTS_HANDLE_T phTTS | Specifies a text-to-speech handle.
| LPSTR pszFileName | Points to a NULL terminated string that specifies the name of the log file to be opened.
| DWORD dwFlags | Specifies the type of output. It can contain one or more of the following constants:
Constants | Description
LOG_TEXT | Log text
LOG_PHONEMES | Log phonemes
LOG_SYLLABLES | Log syllable structure
Return Value | This call returns a value of type MMRESULT. The value is zero if the call is successful. The return value is one of the following constants:
Constants | Description
MMSYSERR_NOERROR | Normal successful completion (zero).
MMSYSERR_INVALPARAM | An invalid parameter was passed.
MMSYSERR_NOMEM | Unable to allocate memory.
MMSYSERR_ALLOCATED | A phoneme file is already open.
MMSYSERR_ERROR | Unable to open the output file.
MMSYSERR_INVALHANDLE | The text-to-speech handle was invalid.
Comments | If more than one of the dwFlags are passed, then the logged output is mixed in an unpredictable fashion. If there is already a log file open, this call returns an error. The Log command has no effect when a log file is already open. The startup function must be called to start the text-to-speech system before calling this function. TextToSpeechOpenLogFile automatically resumes audio output if the text-to-speech system is in a paused state by a previously issued TextToSpeechPause call.
See Also | Log File Mode TextToSpeechCloseLogFile TextToSpeechPause TextToSpeechReset TextToSpeechSpeak TextToSpeechStartup (UNIX) TextToSpeechStartup (Windows) TextToSpeechStartupEx