Package-level declarations

Types

Link copied to clipboard
data class AlignedToken(val reference: String?, val heard: String?, val confidence: Float?, val status: AlignedTokenStatus)

One position in a TranscriptAlignment: an expected word, a heard word, or both.

Link copied to clipboard

How one position of a TranscriptAlignment compares the expected text with what was heard.

Link copied to clipboard

A SpeechRecognizing backed by Android's SpeechRecognizer.

Link copied to clipboard
Link copied to clipboard
data class RecognizedUtterance(val text: String, val words: List<RecognizedWord>, val alternatives: List<String> = emptyList())

A finalized stretch of recognized speech.

Link copied to clipboard
data class RecognizedWord(val text: String, val confidence: Float? = null, val startMillis: Long? = null, val durationMillis: Long? = null)

One word in a recognized utterance, with the recognizer's confidence and timing when reported.

Link copied to clipboard

Inspects and requests the on-device speech recognition models for a language.

Link copied to clipboard
data class SpeechRecognitionConfiguration(val locale: Locale, val preferOnDevice: Boolean = true, val reportsAlternatives: Boolean = true, val requestsWordDetails: Boolean = true, val completeSilenceMillis: Long? = null, val maxAlternatives: Int = DEFAULT_MAX_ALTERNATIVES)

Settings for one speech recognition run.

Link copied to clipboard
sealed interface SpeechRecognitionEvent

An update from a speech recognition run.

Link copied to clipboard
class SpeechRecognitionException(val reason: SpeechRecognitionException.Reason, message: String? = null, cause: Throwable? = null) : Exception

A speech recognition run failed.

Link copied to clipboard

Something that turns microphone speech into a live transcript.

Link copied to clipboard
sealed interface SpeechSynthesisEvent

A progress update while text is being spoken.

Link copied to clipboard
class SpeechSynthesisException(message: String, val errorCode: Int? = null, cause: Throwable? = null) : Exception

Speech synthesis failed.

Link copied to clipboard
data class SpeechSynthesisRequest(val text: String, val languageTag: String, val voiceId: String? = null, val rate: Float = 1.0f, val pitch: Float = 1.0f)

One piece of text to speak.

Link copied to clipboard

Something that speaks text aloud.

Link copied to clipboard
data class SpeechTranscript(val finalizedUtterances: List<RecognizedUtterance> = emptyList(), val volatileText: String = "")

Everything recognized so far in one recognition run.

Link copied to clipboard
data class SpeechVoice(val id: String, val name: String, val languageTag: String, val quality: SpeechVoice.Quality, val requiresNetwork: Boolean)

A text-to-speech voice available on the device.

Link copied to clipboard
data class TranscriptAlignment(val tokens: List<AlignedToken>)

A word-level comparison between the text someone was asked to say and what a speech recognizer heard.

Link copied to clipboard
data class TranscriptToken(val text: String, val confidence: Float? = null)

A word heard by a speech recognizer, with the recognizer's confidence in it when known.