-
Couldn't load subscription status.
- Fork 94
Description
I'm working on a sample Speech-to-text Android App that will timeout after a certain amount of inactivity from the speaker. For testing purposes, I set the timeout at 1 second. However, there seems to be a race condition (which I reproduced in the example by setting the inactivity timeout to 1 second) that causes the MicrophoneHelper to hang on closing.
The hang occurs in MicrophoneCaptureThread.run() line 110 - encoder.close() call. I'm not quite sure what is hanging it up, but if you toggle the microphone and then let it timeout after one or two attempts it will fail this way. The final hang is in MicrophoneInputStream.consume(byte[]).
Here is the link to the sample application I used: https://github.com/watson-developer-cloud/android-sdk/blob/master/example/src/main/java/com/ibm/watson/developer_cloud/android/myapplication/MainActivity.java
The only change I made was to getRecognizeOptions() where I changed the timeout from 2000 to 1.