Search code examples
androidspeech-to-textspeechnexus-5azure-cognitive-services

Project Oxford Speech API: AUDIO_INPUT_FLAG_FAST denied by client


I've been trying to use the Project Oxford Speech API on Android (https://msdn.microsoft.com/en-us/library/mt613453.aspx). I've added my API subscription key into the example project module SpeechRecoExample. However, I get the following error message upon launch:

01-22 17:10:04.234  11661-11661/com.microsoft.AzureIntelligentServicesExample I/NLPLAT﹕ InitializeRenderer@103 originating error 0x80070057 from InitializeRenderer 103
01-22 17:10:04.234  11661-11661/com.microsoft.AzureIntelligentServicesExample I/NLPLAT﹕ Initialize@749 Initializing Audio Services
01-22 17:10:04.236  11661-11661/com.microsoft.AzureIntelligentServicesExample W/AudioRecord﹕ AUDIO_INPUT_FLAG_FAST denied by client; transfer 1, track 16000 Hz, primary 48000 Hz
01-22 17:10:04.246  11661-11661/com.microsoft.AzureIntelligentServicesExample E/AudioRecord﹕ AudioFlinger could not create record track, status: -1
01-22 17:10:04.247  11661-11661/com.microsoft.AzureIntelligentServicesExample E/libOpenSLES﹕ android_audioRecorder_realize(0xab224400) error creating AudioRecord object; status -1
01-22 17:10:04.247  11661-11661/com.microsoft.AzureIntelligentServicesExample W/libOpenSLES﹕ Leaving Object::Realize (SL_RESULT_CONTENT_UNSUPPORTED)
01-22 17:10:04.247  11661-11661/com.microsoft.AzureIntelligentServicesExample I/NLPLAT﹕ Initialize@47 originating error 0x8000ffff from Initialize 47
01-22 17:10:04.247  11661-11661/com.microsoft.AzureIntelligentServicesExample E/NLPLAT﹕ native error -1910439934
01-22 17:10:04.249  11661-11661/com.microsoft.AzureIntelligentServicesExample W/libOpenSLES﹕ class OutputMix interface 0 requested but unavailable MPH=43
01-22 17:10:04.250  11661-11661/com.microsoft.AzureIntelligentServicesExample W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 16000 Hz, output 48000 Hz
01-22 17:10:04.253  11661-11661/com.microsoft.AzureIntelligentServicesExample I/NLPLAT﹕ Load@205 Opening VAD 'raw/vcd/common/grammar/Date.0409.vad.xml'

I figured that these are probably the relevant line in the tons of output. Since most of the logic goes back to the closed-source SpeechAPI, I can't find a good way to debug this. Has anyone every been able to run this example (or any other application) successfully on Android? Any pointers where to dig?

Notes: the app runs fine on the emulator (as well as it starts on hardware), but I can't test the functionality there due to the lack of microphone support. The error message shows up when testing on a Google Nexus 5. I use Ubuntu 14.04 and the Intellij IDE. Authentication with the service works and calls are made (as I can see in my quota), but no (or empty) results are returned.

I could only find one report about the very same error here: https://social.msdn.microsoft.com/Forums/azure/en-US/a23230b8-b7a9-43bb-8390-03036301ee77/android-speech2text-sdk-error?forum=mlapi


Solution

  • This seems to be related to the version of SpeechSDK and the included NDK files. This has apparently not been documented and I have had success after changing the target Android version to 15 and re-compile.

    I have not been able to fully trace back the issue, but it works for me now.