- Applications can perform text-to-speech conversion by calling the function ttsSpeak. Calls to ttsSpeak specify the CT Access handle of an open context of text-to-speech and a pointer to a memory resident buffer. Because NaturalText reads and speaks one text buffer at a time, applications must wait for TTSEVN_SPEAK_DONE events before submitting new buffers.
- In the following example NaturalText takes text from a fixed buffer to pronounce the phrase, "The eagle has landed":
char* text = "The eagle has landed"; /* Text to speak */
CTAHD ctahd; /* CTA handle */
/*...*/
ttsSpeak( ctahd, text );
/*...*/
- Applications can pause or stop active speech with the functions ttsPause or ttsStop. ttsPause interrupts speech and retains the current buffer. When applications resume speech with ttsResume, speech continues from the point where it was interrupted.
- ttsStop interrupts speech and releases the current text buffer. When applications start speech again (with ttsSpeak), speaking starts at the beginning of a specified buffer.
- The following functions start and stop NaturalText speech: