SpeakCFString(_:_:_:)
Begins speaking a string represented as a CFString object.
Declaration
func SpeakCFString(_ chan: SpeechChannel, _ aString: CFString, _ options: CFDictionary?) -> OSErrParameters
- chan:
The speech channel through which speech is to be spoken.
- aString:
The string to be spoken, represented as a
CFStringobject. - options:
An optional dictionary of key-value pairs used to customize speech behavior. See Synthesizer_option_keys for the available keys.
Return Value
A result code. See Result Codes.
Discussion
The SpeakCFString function is the Core Foundation-based equivalent of the SpeakBuffer function.
The SpeakCFString function converts the text string specified in aString into speech, using the voice and control settings in effect for the speech channel specified in chan. (Before you use SpeakCFString, therefore, be sure you’ve created a speech channel with the NewSpeechChannel(_:_:) function.) The SpeakCFString function generates speech asynchronously, which means that control is returned to your application before speech has finished, perhaps even before the speech is first audible.
If SpeakCFString is called while the speech channel is currently speaking the contents of another text string, the speech stops immediately and the new text string is spoken as soon as possible.