Function

SpeakBuffer

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

Declaration

OSErr SpeakBuffer(SpeechChannel chan, const void *textBuf, unsigned long textBytes, SInt32 controlFlags);

Parameters

chan

The speech channel through which speech is to be spoken.

textBuf

A pointer to the first byte of text to spoken.

textBytes

The number of bytes of text to spoken.

controlFlags

Control flags to customize speech behavior.

Return Value

A result code. See Result Codes.

Discussion

The SpeakBuffer function behaves identically to the SpeakText function, but allows control of several speech parameters by setting values of the controlFlags parameter. The controlFlags parameter relies on specific constants, which may be applied additively. See Control Flags Constants.

Each constant specifies a flag bit of the controlFlags parameter, so by passing the constants additively you can enable multiple capabilities of SpeakBuffer. If you pass 0 in the controlFlags parameter, SpeakBuffer works just like SpeakText. By passing kNoEndingProsody + kNoSpeechInterrupt in the controlFlags parameter, SpeakBuffer works like SpeakText except that the kNoEndingProsody and kNoSpeechInterrupt features have been selected. Future versions of the Speech Synthesis Manager may define additional constants.

When the controlFlags parameter is set to 0, SpeakBuffer behaves identically to SpeakText.

See Also

Starting, Stopping, and Pausing Speech

ContinueSpeech

Resumes speech paused by the PauseSpeechAt function.

PauseSpeechAt

Pauses speech on a speech channel.

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.

StopSpeechAt

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