Platforms to show: All Mac Windows Linux Cross-Platform

Back to AVSpeechSynthesizerMBS class.

AVSpeechSynthesizerMBS.availableVoicesDidChange

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
An event that indicates a change in available voices for speech synthesis.

The system posts this notification when available voices for speech synthesis on the system change. For example, a new personal voice becomes available and the user authorized the app to access personal voices. Or new 3rd party voices become available through an app the user downloads.

Some examples using this event:

AVSpeechSynthesizerMBS.didCancelSpeechUtterance(utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer cancels speaking an utterance.

utterance: The utterance that the speech synthesizer cancels speaking.

The system only calls this method if a speech synthesizer is speaking an utterance and the system calls its stopSpeakingAtBoundary method. The system doesn’t call this method if the synthesizer is in a delay between utterances when speech stops, and it doesn’t call it for unspoken utterances.

Some examples using this event:

AVSpeechSynthesizerMBS.didContinueSpeechUtterance(utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer resumes speaking an utterance after pausing.

utterance: The utterance that the speech synthesizer resumes speaking.

The system only calls this method if a speech synthesizer pauses speaking and the system calls its pauseSpeakingAtBoundary method. The system doesn’t call this method if the synthesizer pauses while in a delay between utterances.

Some examples using this event:

AVSpeechSynthesizerMBS.didFinishSpeechUtterance(utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer finishes speaking an utterance.

utterance: The utterance that the speech synthesizer finishes speaking.

The system ignores the final utterance’s postUtteranceDelay and calls this method immediately when speech ends.

Some examples using this event:

AVSpeechSynthesizerMBS.didPauseSpeechUtterance(utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer pauses while speaking an utterance.

utterance: The utterance that the speech synthesizer pauses speaking.

The system only calls this method if a speech synthesizer is speaking an utterance and the system calls its pauseSpeakingAtBoundary method. The system doesn’t call this method if the synthesizer is in a delay between utterances when speech pauses.

Some examples using this event:

AVSpeechSynthesizerMBS.didStartSpeechUtterance(utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer begins speaking an utterance.

utterance: The utterance that the speech synthesizer starts speaking.

If the utterance’s preUtteranceDelay property is greater than zero, the system calls this method after the delay completes and speech begins.

Some examples using this event:

AVSpeechSynthesizerMBS.requestPersonalVoiceAuthorizationCompleted(status as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
A completion event that the system calls after the user responds to a request to authorize use of personal voices, which receives the authorization status as an argument.

AVSpeechSynthesizerMBS.SpeechSynthesizerBuffer(buffer as AVAudioBufferMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The event that receives a buffer of generated speech.

AVSpeechSynthesizerMBS.SpeechSynthesizerMarker(markers() as AVSpeechSynthesisMarkerMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
The event that receives speech markers.

AVSpeechSynthesizerMBS.willSpeakMarker(marker as AVSpeechSynthesisMarkerMBS, utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer is about to speak a marker of an utterance’s text.

marker: The synthesized audio that the speech synthesizer is about to speak.
utterance: The utterance that the speech synthesizer pauses speaking.

AVSpeechSynthesizerMBS.willSpeakRangeOfSpeechString(characterRange as NSRangeMBS, utterance as AVSpeechUtteranceMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Speech MBS AVFoundation Plugin 24.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Tells you when the synthesizer is about to speak a portion of an utterance’s text.

characterRange: The range of characters in the utterance’s speechString that correspond to the unit of speech the synthesizer is about to speak.
utterance: The utterance that the speech synthesizer is about to speak.

The system calls this method once for each unit of speech in the utterance’s text, which is generally a word.

Tip
Implement this method if you want to provide a user interface to visually highlight each word as the synthesizer speaks it.

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


The biggest plugin in space...