Android Speech to Text Issue

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'
android
speech-recognition
speech-to-text
microsoft-cognitive
asked on Stack Overflow Oct 3, 2018 by Ninja • edited Oct 3, 2018 by Ninja

4 Answers

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.

answered on Stack Overflow Oct 3, 2018 by Naveen • edited Oct 4, 2018 by Naveen
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 ----------+ ");
    }
}
answered on Stack Overflow Oct 3, 2018 by Ninja
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.

answered on Stack Overflow Oct 12, 2018 by wolfma
0

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

answered on Stack Overflow Oct 26, 2018 by Ninja

User contributions licensed under CC BY-SA 3.0