com.google.mlkit.genai.texttospeech

Classes

SpeechSynthesizer

Performs on-device text-to-speech audio synthesis.

SpeechSynthesizerOptions

Configuration options for SpeechSynthesizer.

SpeechSynthesizerOptions.Builder

Builder for SpeechSynthesizerOptions.

SpeechSynthesizerRequest

Represents a request to synthesize speech using SpeechSynthesizer.

SpeechSynthesizerRequest.Input

The input to be synthesized.

SpeechSynthesizerRequest.Input.Earcon

An earcon input containing the name of the earcon to play.

SpeechSynthesizerRequest.Input.PreRecordedSpeech

A speech input containing the text string mapped to a pre-recorded audio file.

SpeechSynthesizerRequest.Input.Text

A text input containing the raw string to be synthesized.

SpeechSynthesizerResponse

Represents output events emitted during a speech synthesis session.

SpeechSynthesizerResponse.AudioAvailable

Emitted when a chunk of synthesized audio is available.

SpeechSynthesizerResponse.Error

Emitted when an error occurs during speech synthesis.

SpeechSynthesizerResponse.StatusUpdate

Emitted when the lifecycle status of the synthesis changes.

VoiceInfo

Represents information about a supported text-to-speech voice.

Objects

SpeechSynthesis

Entry point to obtain a SpeechSynthesizer for text-to-speech operations.

Annotations

SpeechSynthesizerRequest.QueueMode

The queue mode annotation.

Enums

SpeechSynthesizerResponse.Status

Lifecycle status of the speech synthesis request.

VoiceInfo.Gender

The gender of a voice.

Top-level functions summary

Top-level functions

speechSynthesizerOptions

fun speechSynthesizerOptions(locale: Locale, init: SpeechSynthesizerOptions.Builder.() -> Unit = {}): SpeechSynthesizerOptions

DSL helper to configure and build SpeechSynthesizerOptions.