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.
PauseSpeechAt
You can use the PauseSpeechAt function to pause speech on a speech channel.
FUNCTION PauseSpeechAt (chan: SpeechChannel; whereToStop: LongInt) : OSErr;
chan- The speech channel on which speech is to be paused.
whereToStop- A constant indicating when speech processing should be paused. Pass the constant
kImmediateto pause immediately, even in the middle of a word. PasskEndOfWordorkEndOfSentenceto pause speech at the end of the current word or sentence, respectively.DESCRIPTION
ThePauseSpeechAtfunction makes speech production pause at a specified point in the text.PauseSpeechAtreturns immediately, although speech output will continue until the specified point.You can determine whether your application has paused speech output on a speech channel by obtaining a speech status information record through the
GetSpeechInfofunction. While a speech channel is paused, the speech status information record indicates thatoutputBusyandoutputPausedare bothTRUE.If the end of the input text buffer is reached before the specified pause point, speech output pauses at the end of the buffer.
The
PauseSpeechAtfunction differs from theStopSpeechandStopSpeechAtfunctions in that a subsequent call toContinueSpeech, described next, causes the contents of the current text buffer to continue being spoken.
- WARNING
- If you plan to continue speech synthesis from a paused speech channel, the text buffer being processed must remain available at all times and must not move while the channel is in a paused state.
![]()
SPECIAL CONSIDERATIONS
Because thePauseSpeechAtfunction might move or purge memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePauseSpeechAtfunction are
Trap macro Selector _SoundDispatch$0434000C RESULT CODES
noErr 0 No error invalidComponentID -3000 Speech channel is uninitialized or bad