Previous Book Contents Book Index Next

Inside Macintosh: Sound /
Chapter 4 - Speech Manager / Speech Manager Reference
Speech Manager Routines / Starting, Stopping, and Pausing Speech


Legacy Documentclose button

Important: Inside Macintosh: Sound is deprecated as of Mac OS X v10.5. For new audio development in Mac OS X, use Core Audio. See the Audio page in the ADC Reference Library.

StopSpeech

You can use the StopSpeech function to terminate speech immediately on a specified channel.

FUNCTION StopSpeech (chan: SpeechChannel): OSErr;
chan
The speech channel on which speech is to be stopped.
DESCRIPTION
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 Manager).

SPECIAL CONSIDERATIONS
Because the StopSpeech function might move or purge memory, you should not call it at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the StopSpeech function are
Trap macroSelector
_SoundDispatch$022C000C

RESULT CODES
noErr0No error
invalidComponentID-3000Speech channel is uninitialized or bad
SEE ALSO
Before calling the StopSpeech function, you can use the SpeechBusy function, which is described on page 4-72, to determine if a synthesizer is still speaking. If you are working with multiple speech channels, you can use the status selector with the routine GetSpeechInfo which is described on page 4-77, to determine if a specific channel is still speaking.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996