SpeechRecognizerResponse.FinalTextResponse

public final class SpeechRecognizerResponse.FinalTextResponse extends SpeechRecognizerResponse


Final recognition result from speech recognition.

Summary

Public constructors

Public methods

final @NonNull String

The final recognized text.

final @NonNull List<@NonNull 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

public FinalTextResponse(
    @NonNull String text,
    @NonNull List<@NonNull SpeechRecognizerResponse.WordTiming> wordTimings
)

Public methods

getText

public final @NonNull String getText()

The final recognized text.

getWordTimings

public final @NonNull List<@NonNull SpeechRecognizerResponse.WordTiming> getWordTimings()

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.