Function

StopSpeech

Terminates speech immediately on the specified channel.

Declaration

OSErr StopSpeech(SpeechChannel chan);

Parameters

chan

The speech channel on which speech is to be stopped.

Return Value

A result code. See Result Codes.

Discussion

The StopSpeech function immediately terminates speech on the channel specified by the chan parameter. After returning from StopSpeech, your application can safely release any text buffer that the speech synthesizer has been using. You can call StopSpeech for an already idle channel without ill effect.

You can also stop speech by passing a zero-length string (or, in C, a null pointer) to one of the SpeakString, SpeakText, or SpeakBuffer functions. Doing this stops speech only in the specified speech channel (or, in the case of SpeakString, in the speech channel managed internally by the Speech Synthesis Manager).

Before calling the StopSpeech function, you can use the SpeechBusy function, which is described in SpeechBusy, to determine if a synthesizer is still speaking. If you are working with multiple speech channels, you can use the status selector with the function GetSpeechInfo which is described in GetSpeechInfo, to determine if a specific channel is still speaking.

See Also

Starting, Stopping, and Pausing Speech

ContinueSpeech

Resumes speech paused by the PauseSpeechAt function.

PauseSpeechAt

Pauses speech on a speech channel.

SpeakBuffer

Speaks a buffer of text, using certain flags to control speech behavior.

Deprecated
SpeakString

Begins speaking a text string.

Deprecated
SpeakCFString

Begins speaking a string represented as a CFString object.

SpeakText

Begins speaking a buffer of text.

Deprecated
StopSpeechAt

Terminates speech delivery on a specified channel either immediately or at the end of the current word or sentence.