【问题标题】:bing speech to text error in AndroidAndroid中的bing语音到文本错误
【发布时间】:2016-09-16 06:47:02
【问题描述】:

我已经阅读了 bing 语音转文本 api 的文档,我实现了一个简单的应用程序,它只需单击按钮即可开始语音转文本。我已经硬编码了认知服务控制台中提供的键值。现在,当我启动示例应用程序中所示的函数时,它会引发以下错误。我在谷歌上搜索过,但我无法追踪问题的根源。

    09-16 11:39:09.799 25615 25655 I NLPLAT  : originating error 0x80070057
    09-16 11:39:09.809 25615 25655 I NLPLAT  : Application Name:
    09-16 11:39:09.819 25615 25655 I NLPLAT  : originating error 0x80070057
    09-16 11:39:09.819 25615 25655 I NLPLAT  : originating error 0x80070057
    09-16 11:39:09.819  3676  4433 D EnterpriseController: netId is 0
    09-16 11:39:09.819  3676  4433 D Netd    : getNetworkForDns: using netid 0 for uid 10068
    09-16 11:39:09.824 25615 26122 I NLPLAT  : originating error 0x8e200005
    09-16 11:39:09.824 25615 25655 I NLPLAT  : Refreshing token S
    09-16 11:39:09.824  3676  4433 D EnterpriseController: netId is 0
    09-16 11:39:09.824  3676  4433 D Netd    : getNetworkForDns: using netid 0 for uid 10068
    09-16 11:39:09.829 25615 26124 I NLPLAT  : originating error 0x8e200005
    09-16 11:39:09.829 25615 25655 I NLPLAT  : Initializing Audio Services
    09-16 11:39:09.829 25615 25655 W libOpenSLES: class OutputMix interface 0 requested but unavailable MPH=43
    09-16 11:39:09.834 25615 25655 W AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by client; transfer 1, track 16000 Hz, output 48000 Hz
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Initializing Speech Services
    09-16 11:39:09.834 25615 25655 I NLPLAT  : No application id provided to controller
    09-16 11:39:09.834 25615 25655 I NLPLAT  : GetIdentityPropertyValue 3
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Useragent Value Android Assistant (Android; Unknown;Unknown;ProcessName/AppName=Unknown;DeviceType=Near;SpeechClient=1.0.160511)
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Url: 'https://websockets.platform.bing.com/ws/speech/recognize/continuous'
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Locale: 'en-us'
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Application Id: ''
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Version: 4.0.150429
    09-16 11:39:09.834 25615 25655 I NLPLAT  : UserAuthorizationToken:
    09-16 11:39:09.834 25615 25655 I NLPLAT  : ServerLoggingLevel: 1
    09-16 11:39:09.834 25615 25655 I NLPLAT  : Initiating websocket connection. m_connection=0x0 host=websockets.platform.bing.com port=443

Bing OnError 函数说:

NameNotFound -1910505467

【问题讨论】:

  • 找了一阵子,把targetSDKVersion从23改成22就可以了!

标签: android speech-to-text bing speech microsoft-cognitive


【解决方案1】:

由于网络连接,我遇到了同样的问题。请在调用“this.micClient.startMicAndRecognition();”之前检查您的网络连接喜欢

 if(isNetworkAvailable()){
                this.micClient.startMicAndRecognition();
            }else{
                Log.i("Error","No network available");
            }

 public boolean isNetworkAvailable() {
        ConnectivityManager cm =
                (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo netInfo = cm.getActiveNetworkInfo();
        return netInfo != null && netInfo.isConnectedOrConnecting();
    }

【讨论】:

    猜你喜欢
    • 2017-10-29
    • 1970-01-01
    • 2015-06-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多