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
kImmediate
to pause immediately, even in the middle of a word. PasskEndOfWord
orkEndOfSentence
to pause speech at the end of the current word or sentence, respectively.DESCRIPTION
ThePauseSpeechAt
function makes speech production pause at a specified point in the text.PauseSpeechAt
returns 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
GetSpeechInfo
function. While a speech channel is paused, the speech status information record indicates thatoutputBusy
andoutputPaused
are 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
PauseSpeechAt
function differs from theStopSpeech
andStopSpeechAt
functions 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 thePauseSpeechAt
function might move or purge memory, you should not call it at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePauseSpeechAt
function are
Trap macro Selector _SoundDispatch
$0434000C RESULT CODES
noErr 0 No error invalidComponentID -3000 Speech channel is uninitialized or bad