Android RecognizerThread should generate OnError instead of runtimeException when nread < 0
未关闭
- 主要语言
- 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 还没有评估数据。