牛津项目演讲 API:AUDIO_INPUT_FLAG_FAST 被客户拒绝

Project Oxford Speech API: AUDIO_INPUT_FLAG_FAST denied by client

我一直在尝试在 Android (https://msdn.microsoft.com/en-us/library/mt613453.aspx) 上使用 Project Oxford Speech API。我已将 API 订阅密钥添加到示例项目模块 SpeechRecoExample 中。但是,我在启动时收到以下错误消息:

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'

我认为这些可能是吨产量中的相关行。由于大部分逻辑都可以追溯到闭源 SpeechAPI,我找不到调试它的好方法。是否有人能够在 Android 上成功 运行 这个示例(或任何其他应用程序)?有什么地方可以挖掘吗?

注意:该应用 运行 在模拟器上运行良好(以及在硬件上启动),但由于缺少麦克风支持,我无法测试那里的功能。在 Google Nexus 5 上测试时出现错误消息。我使用 Ubuntu 14.04 和 Intellij IDE。使用服务进行身份验证并进行调用(正如我在配额中看到的那样),但没有返回(或为空)结果。

我在这里只能找到一份关于相同错误的报告:https://social.msdn.microsoft.com/Forums/azure/en-US/a23230b8-b7a9-43bb-8390-03036301ee77/android-speech2text-sdk-error?forum=mlapi

这似乎与SpeechSDK的版本和包含的NDK文件有关。这显然没有记录在案,我在将目标 Android 版本更改为 15 和 re-compile.

后取得了成功

我无法完全追溯这个问题,但它现在对我有用。