AVSpeechSynthesizer Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Synthesizes speech and raises events relating to text-to-speech.
[Foundation.Register("AVSpeechSynthesizer", true)]
public class AVSpeechSynthesizer : Foundation.NSObject
[<Foundation.Register("AVSpeechSynthesizer", true)>]
type AVSpeechSynthesizer = class
inherit NSObject
- Inheritance
- Attributes
Remarks
In its simplest form, text-to-speech can be done with just two classes:
var ss = new AVSpeechSynthesizer();
var su = new AVSpeechUtterance("Microphone check. One, two, one two.") {
Rate = 0.25f
};
ss.SpeakUtterance(su);
The AVSpeechSynthesizer maintains an internal queue of AVSpeechUtterances. The queue is not accessible to application developers, but the synthesizer can be paused or stopped with PauseSpeaking(AVSpeechBoundary) and StopSpeaking(AVSpeechBoundary). Events such as DidStartSpeechUtterance or WillSpeakRangeOfSpeechString are opportunities for the application developer to modify previously-enqueued sequences.
Constructors
| Name | Description |
|---|---|
| AVSpeechSynthesizer() |
Creates a new AVSpeechSynthesizer with default values. |
| AVSpeechSynthesizer(NativeHandle) |
A constructor used when creating managed representations of unmanaged objects. Called by the runtime. |
| AVSpeechSynthesizer(NSObjectFlag) |
Constructor to call on derived classes to skip initialization and merely allocate the object. |
Properties
| Name | Description |
|---|---|
| AccessibilityAttributedUserInputLabels | (Inherited from NSObject) |
| AccessibilityRespondsToUserInteraction | (Inherited from NSObject) |
| AccessibilityTextualContext | (Inherited from NSObject) |
| AccessibilityUserInputLabels | (Inherited from NSObject) |
| Class | (Inherited from NSObject) |
| ClassHandle |
The Objective-C class handle for this class. |
| DebugDescription | (Inherited from NSObject) |
| Delegate |
An instance of the AVFoundation.IAVSpeechSynthesizerDelegate model class which acts as the class delegate. |
| Description | (Inherited from NSObject) |
| ExposedBindings | (Inherited from NSObject) |
| Handle |
Handle (pointer) to the unmanaged object representation. (Inherited from NSObject) |
| IsDirectBinding | (Inherited from NSObject) |
| IsProxy | (Inherited from NSObject) |
| MixToTelephonyUplink | |
| OutputChannels | |
| Paused |
Whether text-to-speech is currently paused. |
| PersonalVoiceAuthorizationStatus | |
| RetainCount | (Inherited from NSObject) |
| Self | (Inherited from NSObject) |
| Speaking |
Whether the synthesizer is currently speaking, or has utterances queued. Ignores Paused |
| Superclass | (Inherited from NSObject) |
| SuperHandle |
Handle used to represent the methods in the base class for this NSObject. (Inherited from NSObject) |
| UsesApplicationAudioSession | |
| WeakDelegate | |
| Zone | (Inherited from NSObject) |
Methods
Events
| Name | Description |
|---|---|
| DidCancelSpeechUtterance | |
| DidContinueSpeechUtterance | |
| DidFinishSpeechUtterance | |
| DidPauseSpeechUtterance | |
| DidStartSpeechUtterance | |
| WillSpeakMarker | |
| WillSpeakRangeOfSpeechString | |