2016-09-16 20 views
1

我已经通过bing语言文档API的文档,我实现了一个简单的应用程序,只是按钮点击开始语音文本。我对Cognitive Services控制台中提供的关键值进行了硬编码。现在,当我开始示例应用程序中显示的功能时,它会引发以下错误。我在谷歌搜索,但我无法追查问题的根源。bing语言到Android中的文本错误

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 

兵的OnError功能说:

NameNotFound -1910505467 
+0

搜索了一段时间后,将targetSDKVersion从23更改为22,它工作! –

回答

0

我有,因为网络的同一个问题connection.Check之前调用您的网络连接 “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(); 
    }