Android

时间:2016-09-16 06:47:03

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

我已经将bing语音的文档记录到文本api,我实现了一个简单的应用程序,它只是在按钮点击时启动语音到文本。我已经对Cognitive Services控制台中提供的键值进行了硬编码。现在当我启动示例应用程序中显示的函数时,它会抛出以下错误。我在谷歌上搜索过,但我无法追查问题的根源。

    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

1 个答案:

答案 0 :(得分:0)

由于网络连接,我遇到了同样的问题。在调用“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();
    }