4

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?

Vishal
  • 53
  • 2
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Nov 29 '21 at 16:44
  • any follow up on this? – confusedstudent Jan 21 '22 at 08:28
  • This [EXTRA_AUDIO_INJECT_SOURCE](https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_AUDIO_INJECT_SOURCE) only exists since API level **31** and was quickly deprecated and replaced by [EXTRA_AUDIO_SOURCE](https://developer.android.com/reference/android/speech/RecognizerIntent#EXTRA_AUDIO_SOURCE) in API level **33**. It is unclear what you have tried, so I am unable to provide further suggestions. Try https://stackoverflow.com/q/70790026/2597758 . – WebViewer Jan 12 '23 at 08:57

0 Answers0