SpeechSynthesizer Class

Definition

Performs speech synthesis to speaker, file, or other audio output streams, and gets synthesized audio as result. Updated in 1.16.0

public sealed class SpeechSynthesizer : IDisposable
type SpeechSynthesizer = class
    interface IDisposable
Public NotInheritable Class SpeechSynthesizer
Implements IDisposable
Inheritance
SpeechSynthesizer
Implements

Remarks

See also: Get started with text-to-speech

Constructors

SpeechSynthesizer(EmbeddedSpeechConfig, AudioConfig)

Creates a new instance of SpeechSynthesizer using EmbeddedSpeechConfig. Added in 1.19.0

SpeechSynthesizer(EmbeddedSpeechConfig)

Creates a new instance of SpeechSynthesizer using EmbeddedSpeechConfig. Added in 1.19.0

SpeechSynthesizer(HybridSpeechConfig, AudioConfig)

Creates a new instance of SpeechSynthesizer using HybridSpeechConfig.

SpeechSynthesizer(HybridSpeechConfig)

Creates a new instance of SpeechSynthesizer using HybridSpeechConfig.

SpeechSynthesizer(SpeechConfig, AudioConfig)

Creates a new instance of SpeechSynthesizer.

SpeechSynthesizer(SpeechConfig, AutoDetectSourceLanguageConfig, AudioConfig)

Creates a new instance of SpeechSynthesizer. Added in 1.13.0

SpeechSynthesizer(SpeechConfig)

Creates a new instance of SpeechSynthesizer.

Properties

AuthorizationToken

Gets/sets authorization token used to communicate with the service. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. Otherwise, the synthesizer will encounter errors while speech synthesis. Added in 1.7.0

Properties

The collection of properties and their values defined for this SpeechSynthesizer. Note: The property collection is only valid until the SpeechSynthesizer owning this Properties is disposed or finalized.

Methods

Dispose()

Dispose of associated resources.

Finalize()
GetVoicesAsync(String)

Get the available voices. Added in 1.16.0

SpeakAsync(SpeechSynthesisRequest)

Execute the speech synthesis on request, asynchronously. This API could be used to synthesize speech from an input text stream, to reduce latency for text generation scenarios. Note: the feature is in preview and is subject to change. Added in version 1.37.0

SpeakSsmlAsync(String)

Synthesize speech from SSML asynchronously (returns when done synthesizing).

SpeakTextAsync(String)

Synthesize speech from plain text asynchronously (returns when done synthesizing).

StartSpeakingAsync(SpeechSynthesisRequest)

Queue the speech synthesis on request, as an asynchronous operation. This API could be used to synthesize speech from an input text stream, to reduce latency for text generation scenarios. Note: the feature is in preview and is subject to change. Added in version 1.37.0

StartSpeakingSsmlAsync(String)

Queue speech synthesis task from SSML as an asynchronous operation.

StartSpeakingTextAsync(String)

Queue speech synthesis task from plain text as an asynchronous operation.

StopSpeakingAsync()

Stop speech synthesis.

Events

BookmarkReached

Signals that a bookmark was reached. Added in 1.16.0

SynthesisCanceled

Signals that the speech synthesis was canceled.

SynthesisCompleted

Signals that speech synthesis has completed.

SynthesisStarted

Signals that speech synthesis has started.

Synthesizing

Signals that speech synthesis is ongoing. This event fires each time the SDK receives an audio chunk from the Speech service.

VisemeReceived

Signals that a viseme event was received. Added in 1.16.0

WordBoundary

Signals that a word boundary was received. Added in 1.7.0

Applies to