2

i'm trying to test Cognitive-Speech-STT-Android Sample Project on my Android device after adding the client library dependency to Andoid Studio, creating a trial account and adding the Uri & primarykey weird behavior are causing the application to return this Log and no text result received:

Screen Capture

Android Studio Log:

I/NLPLAT: Auth token status: 404
originating error 0x8000ffff
10-03 14:41:43.902 21547-22632/com.example.robotvoicedemo I/NLPLAT: 
originating error 0x80070057
Authorization token hr 80070057 'S' 
Refreshing token S
Waiting for connection/send completion.
Transport error, hr=8E200002

I/NLPLAT: WebSocket closed unexpectedly, status: 0
Closing web socket channel
CU Client connection dropped
ConnectionStateChanged
Upgrade request returned with HTTP status code: 401.
Web socket handshake failed, hr=8E200002
web socket message delivery failed, hr=8E200002
Web socket channel already closed.
Message: 'S' has -1206569628 remaining transmit attempts.
Discarding failed message (name='S')
Reporting message failure to the observer (name='S')
Failed to 'hr', HR=8E200002, Failed to send message (name='S')
Transport error, hr=8E200002
Web socket channel already closed.
Message: 'S' has -1206569628 remaining transmit attempts.
Retrying message, name='S'
Ninja
  • 105
  • 9

4 Answers4

2

UPDATE: The below function you used to detect connection determines if it is connected to network and it does not determine you have internet access on the connected network.However that does not appear to be problem in your case, experiment with google speech recogniser and see if the same problem occurs,Needs some more info to provide you a solution

web socket connections are designed to disconnect when there is no network.Please make sure you have active internet connection or you probably didnt add <uses-permission android:name="android.permission.INTERNET" /> to manifest.

Naveen
  • 769
  • 1
  • 9
  • 28
  • Hello Naveen, i did add the permission and the device is connected, also tested the connection status from code : '' – Ninja Oct 03 '18 at 18:49
  • Thanks The reason i'm using Azure is i'm getting Error 3 (Audio Error) on google speech recognizer even after installing Google App(com.google.android.googlequicksearchbox) – Ninja Oct 04 '18 at 13:27
  • Is this works same on all devices? try another emulator (or ) try this one https://stackoverflow.com/questions/5253740/speech-to-text-recognizer-not-found – Naveen Oct 04 '18 at 16:54
  • i did install google service and enable it from adb using: (adb shell==>su==>pm enable com.google.android.googlequicksearchbox Got Package com.google.android.googlequicksearchbox new state: enabled ) still same the issue – Ninja Oct 04 '18 at 19:55
  • Yes it did, what i'm suspecting at this point, the service is deactivated from OS Architecture layers – Ninja Oct 05 '18 at 11:26
  • interesting, i too built a voice assistant app, but it worked fine in emulator.Install another image and try a different emulator – Naveen Oct 05 '18 at 11:56
2

i did add the permission and the device is connected, also tested the connection status from code : '

 private void checknetwork(){
    ConnectivityManager cm = (ConnectivityManager)BingTest.this.getSystemService(Context.CONNECTIVITY_SERVICE);

    NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
    boolean isConnected = activeNetwork != null &&
            activeNetwork.isConnectedOrConnecting();

    if(isConnected){
        Log.i(TAG, "Device is Connected ++++++++++++ ");
    }else{
        Log.i(TAG, "Device is Not Connected ----------+ ");
    }
}
Ninja
  • 105
  • 9
1

Are you using this sample? https://github.com/Azure-Samples/Cognitive-Speech-STT-Android

if that is correct:

Since September Microsoft has a new Speech related Cognitive Services SDK:

We released a new Speech SDK supporting the new Unified Speech Service. The new Speech SDK comes with support for Windows, Android, Linux, Javascript and iOS.

Please check out Microsoft Cognitive Services Speech SDK for documentation (http://aka.ms/csspeech), links to the download pages, and the samples.

wolfma
  • 426
  • 2
  • 3
1

in case some one face the same issue i had, it turn out the MediaRecorder was blocked by another app the issue was solved after deleting the other App

Ninja
  • 105
  • 9