ASRState

interface ASRState

Represents the various states of an Automatic Speech Recognition (ASR) engine.

This sealed interface defines a finite set of possible states that describe the lifecycle and result of a speech recognition session. It is intended to be used with reactive streams (e.g. StateFlow) to observe and respond to recognition state changes.

Types

Link copied to clipboard
class Error(val error: Throwable) : ASRState

Indicates that an error has occurred during the speech recognition process.

Link copied to clipboard
object Idle : ASRState

Indicates that the ASR engine is idle and not actively listening or processing audio.

Link copied to clipboard
object Interrupted : ASRState

Indicates that the recognition was interrupted unexpectedly (e.g., by external factors such as app lifecycle events).

Link copied to clipboard
object InterruptedByTimeout : ASRState

Indicates that the recognition session was interrupted due to a timeout.

Link copied to clipboard
class Listening(val text: String) : ASRState

Indicates that the ASR engine is currently listening to the user's speech.

Link copied to clipboard
object NoResult : ASRState

Indicates that no recognizable speech was detected during the session.

Link copied to clipboard
class Result(val text: String, val feedbackType: String) : ASRState

Indicates that the final recognition result is available.

Link copied to clipboard
object SpeechFinishedWaitingForResult : ASRState

Indicates that the user has finished speaking and the engine is now waiting for the final recognition result.

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard