FakeSpeechRecognizer

class FakeSpeechRecognizer(var script: List<SpeechRecognitionEvent> = emptyList(), var error: SpeechRecognitionException? = null) : SpeechRecognizing

Scripted SpeechRecognizing for consumer tests.

Each collected run emits script in order, then throws error if set, otherwise completes. Runs and stop calls are recorded.

Constructors

Link copied to clipboard
constructor(script: List<SpeechRecognitionEvent> = emptyList(), error: SpeechRecognitionException? = null)

Properties

Link copied to clipboard

The configuration of every run started, in order.

Link copied to clipboard

An exception thrown after the script, or null to complete normally.

Link copied to clipboard

The events every run emits.

Link copied to clipboard

How many times stop was called.

Functions

Link copied to clipboard
open override fun recognize(configuration: SpeechRecognitionConfiguration): Flow<SpeechRecognitionEvent>
Link copied to clipboard
open override fun stop()