Android RecognizerIntent documentation states that
public static final String EXTRA_AUDIO_INJECT_SOURCE
The extra key used in intent is providing an already opened audio source for the RecognitionService to use. Data should be a URI to an audio resource.
https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_AUDIO_INJECT_SOURCE
But there are no other references or user documentation for this key. As such, it is not clear how this feature works and what to pass as data with this key.
I have tried passing a Uri for an audio recording file in res/raw
, but the SpeechRecognizer in the Android 12 emulator ignored the file.
Can somebody point me in the correct direction on how to properly inject an Audio Resource / Source in SpeechRecognizer?