Function

StopSpeechAt

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

Declaration

OSErr StopSpeechAt(SpeechChannel chan, SInt32 whereToStop);

Parameters

chan

The speech channel on which speech is to be stopped.

whereToStop

A constant indicating when speech processing should stop. Pass the constant kImmediate to stop immediately, even in the middle of a word. Pass kEndOfWord or kEndOfSentence to stop speech at the end of the current word or sentence, respectively.

Return Value

A result code. See Result Codes.

Discussion

The StopSpeechAt function halts the production of speech on the channel specified by chan at a specified point in the text. This function returns immediately, although speech output continues until the specified point has been reached.

If you call the StopSpeechAt function before the Speech Synthesis Manager finishes processing input text, then the function might return before some input text has yet to be spoken. Thus, before disposing of the text buffer, your application should wait until its text-done callback function has been called (if one has been defined), or until it can determine (by, for example obtaining a speech status information structure) that the Speech Synthesis Manager is no longer processing input text.

If the end of the input text buffer is reached before the specified stopping point, the speech synthesizer stops at the end of the buffer without generating an error.

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
StopSpeech

Terminates speech immediately on the specified channel.