contents.gifindex.gifprev1.gifnext1.gif

TextToSpeechOpenWaveOutFile

The TextToSpeechOpenWaveOutFile call causes the specified wave file to be opened and the text-to-speech system to enter into wave-file mode. This mode indicates that the speech samples are to be written in wave format into the wave file each time TextToSpeechSpeak is called. The text-to-speech system remains in the wave-file mode until TextToSpeechCloseWaveOutFile is called

Syntax
MMRESULT TextToSpeechOpenWaveOutFile
(LPTTS_HANDLE_T phTTS,
LPSTR pszFileName,
DWORD dwFormat)
Parameters
LPTTS_HANDLE_T phTTS
Specifies a text-to-speech handle.

LPSTR pszFileName
Specifies a pointer to a file name.

DWORD dwFormat
Determines the audio sample format. It can be one of the following constants that are defined in 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, DECtalk00090008.gif-law 8 kHz sample rate


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
An invalid parameter or an illegal wave output format was passed.
MMSYSERR_NOMEM
Memory allocation error.
MMSYSERR_ALLOCATED
A wave file is already open.
MMSYSERR_ERROR
Unable to open the wave file or unable to write to the wave file.
MMSYSERR_INVALHANDLE
The text-to-speech handle was invalid.


Comments
This call automatically resumes audio output if the text-to-speech system is in a paused state by a previously issued TextToSpeechPause call.
The startup function must be called to start the text-to-speech system before calling TextToSpeechOpenWaveOutFile.
See Also
TextToSpeechCloseWaveOutFile
TextToSpeechPause
TextToSpeechReset
TextToSpeechSpeak
TextToSpeechStartup (UNIX)
TextToSpeechStartup (Windows)
TextToSpeechStartupEx
Wave-File Mode