Skip to content

Speech to Text: OggOpusEncoder hanging on close after Inactivity Timeout #50

@smccants

Description

@smccants

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions