Platforms to show: All Mac Windows Linux Cross-Platform

AVSpeechSynthesizerMBS class   New in 24.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
An object that produces synthesized speech from text utterances and enables monitoring or controlling of ongoing speech.

To speak some text, create an AVSpeechUtteranceMBS instance that contains the text and pass it to speakUtterance on a speech synthesizer instance. You can optionally also retrieve an AVSpeechSynthesisVoiceMBS and set it on the utterance’s voice property to have the speech synthesizer use that voice when speaking the utterance’s text.

The speech synthesizer maintains a queue of utterances that it speaks. If the synthesizer isn’t speaking, calling speakUtterance: begins speaking that utterance either immediately or after pausing for its preUtteranceDelay, if necessary. If the synthesizer is speaking, the synthesizer adds utterances to a queue and speaks them in the order it receives them.
After speech begins, you can use the synthesizer object to pause or stop speech. After pausing, you can resume the speech from its paused point or stop the speech entirely and remove all remaining utterances in the queue.
You can monitor the speech synthesizer by examining its speaking and paused properties, or by adding events.

An AVSpeechSynthesizerMBS also controls the route where the speech plays. For more information, see Directing speech output.

The system doesn’t automatically retain the speech synthesizer, so you need to manually retain it until speech concludes.

Speech Boundaries

Constant Value Description
SpeechBoundaryImmediate 0 Indicates to pause or stop speech immediately.
SpeechBoundaryWord 1 Indicates to pause or stop speech after the synthesizer finishes speaking the current word.

Authorization Status

Constant Value Description
SpeechSynthesisPersonalVoiceAuthorizationStatusAuthorized 3 The user granted your app’s request to use personal voices.
SpeechSynthesisPersonalVoiceAuthorizationStatusDenied 1 The user denied your app’s request to use personal voices.
SpeechSynthesisPersonalVoiceAuthorizationStatusNotDetermined 0 The app hasn’t requested authorization to use personal voices.
SpeechSynthesisPersonalVoiceAuthorizationStatusUnsupported 2 The device doesn’t support personal voices.

This class has no sub classes.

Blog Entries

Release notes

The items on this page are in the following plugins: MBS AVFoundation Plugin.

AVSpeechSynthesisVoiceMBS   -   AVSpeechUtteranceMBS

The biggest plugin in space...