pub struct SpeechSynthesizer { /* private fields */ }
Expand description

SpeechSynthesizer struct holds functionality for text-to-speech synthesis.

Implementations

Executes the speech synthesis on plain text, asynchronously.

Executes the speech synthesis on SSML, asynchronously.

Starts the speech synthesis on plain text, asynchronously. It returns when the synthesis request is started to process (the result reason is SynthesizingAudioStarted).

Starts the speech synthesis on SSML, asynchronously. It returns when the synthesis request is started to process (the result reason is SynthesizingAudioStarted).

Stops the speech synthesis, asynchronously. It stops audio speech synthesis and discards any unread data in audio.PullAudioOutputStream.

Gets the available voices, asynchronously. The parameter locale specifies the locale of voices, in BCP-47 format; or leave it empty to get all available voices.

Sets the authorization token that will be used for connecting to 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 during synthesizing.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.