SpeechRecognizerResponse.FinalTextResponse

data class SpeechRecognizerResponse.FinalTextResponse : SpeechRecognizerResponse


Final recognition result from speech recognition.

Summary

Public constructors

FinalTextResponse(
    text: String,
    wordTimings: List<SpeechRecognizerResponse.WordTiming>
)

Public properties

String

The final recognized text.

List<SpeechRecognizerResponse.WordTiming>

The list of WordTiming if word timing was enabled and supported by the AudioSource mode, or an empty list otherwise.

Public constructors

FinalTextResponse

FinalTextResponse(
    text: String,
    wordTimings: List<SpeechRecognizerResponse.WordTiming> = emptyList()
)

Public properties

text

val text: String

The final recognized text.

wordTimings

val wordTimings: List<SpeechRecognizerResponse.WordTiming>

The list of WordTiming if word timing was enabled and supported by the AudioSource mode, or an empty list otherwise. Note that word timing is only available for streaming audio (e.g., AudioSource.Mode.STREAMING or AudioSource.fromMic), and not for AudioSource.Mode.ONE_SHOT.