alphacep / alphacep/vosk-api

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

Đang mở
#830 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Jupyter Notebook
Star
15.1k
Fork
1.8k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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));
}

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.