AndroidSpeechRecognitionSession
A SpeechRecognizing backed by Android's SpeechRecognizer.
Each recognize collection creates a recognizer, drives it on the main thread, and destroys it when the flow ends or is cancelled. Only one run can be active at a time; a second concurrent collection fails with SpeechRecognitionException.Reason.Busy. The host app must hold the RECORD_AUDIO permission, otherwise the run fails with SpeechRecognitionException.Reason.PermissionDenied.
When SpeechRecognitionConfiguration.preferOnDevice is set and on-device recognition is available (Android 12 and later) a dedicated on-device recognizer is used; otherwise the system recognizer is used with the offline preference. Per-word confidence and timing require Android 14. If the recognizer reports no match after partial text was heard, that text is delivered as the final result instead of failing.
The logger receives lengths, locales, and error codes only, never transcript text.
Parameters
Any context; the application context is retained.
Receives diagnostic messages. Defaults to NoOpLogger.
Functions
Starts one recognition run.