Instance Method

speak(_:)

Enqueues an utterance to be spoken.

Declaration

func speak(_ utterance: AVSpeechUtterance)

Parameters

utterance

An AVSpeechUtterance object containing text to be spoken.

Discussion

The AVSpeechUtterance object not only contains the text to be spoken, but also parameters controlling speech synthesis such as voice, pitch, and delays between utterances.

Calling this method adds the utterance to a queue; utterances are spoken in the order in which they are added to the queue. If the synthesizer is not currently speaking, the utterance is spoken immediately. Attempting to enqueue AVSpeechUtterance instance multiple times throws an exception.

See Also

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software