alphacep / alphacep/vosk-api

Android RecognizerThread should generate OnError instead of runtimeException when nread < 0

オープン
#830 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Jupyter Notebook
スター
15.1k
フォーク
1.8k
PR マージ指標
30日以内にマージされた PR はありません

説明

The problem is when there is a problem with Android AudioRecord, the error condition generates a runtime exception that can't be trapped within my app.

The problem is in: /vosk-api/android/lib/src/main/java/org/vosk/android/SpeechService.java

At line 227, instead of generating a runtime exception, it would be better if it could generate something that ends up in "onError". This is my suggested code fix.

if (nread < 0) {
IOException ioe = new IOException(
"error reading audio buffer. code= " + nread);
mainHandler.post(() -> listener.onError(ioe));
}

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。