Open sckalman opened 6 years ago
i am also meet the issue?
I am facing similar issue. The listener does not work until this issue comes up. Post crash, the listener starts working. Below is the trace
Service: Error calling the API. io.grpc.StatusRuntimeException: OUT_OF_RANGE: Audio data is being streamed too fast. Please stream audio data approximately at real time. at io.grpc.Status.asRuntimeException(Status.java:543) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:395) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426) at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)
Please Suggest Same I am facing.
Caused by: io.grpc.StatusRuntimeException: OUT_OF_RANGE: Audio Timeout Error: Long duration elapsed without audio. Audio should be sent close to real time. at io.grpc.Status.asRuntimeException(Status.java:530) ... 23 more java.util.concurrent.ExecutionException: com.google.api.gax.rpc.OutOfRangeException: io.grpc.StatusRuntimeException: OUT_OF_RANGE: Audio Timeout Error: Long duration elapsed without audio. Audio should be sent close to real time. at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:531) at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:512) at com.google.common.util.concurrent.AbstractFuture$TrustedFuture.get(AbstractFuture.java:83) at org.apache.jsp.speechToText_jsp._jspService(speechToText_jsp.java:255) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
Is there someone slove this?
Not yet i need solution and looking for it
Sent from my iPhone
On 14-Jun-2019, at 2:59 PM, lansedebing notifications@github.com wrote:
Is there someone slove this?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
I was facing this issue while using streamingRecognizeCallable()
(in Kotlin), after the user signalled end of audio by clicking button, I just stopped audio emitter and thus stopped streaming sound data to recognition service. While the interim results were good, the "final=true" result was received only several seconds (like 3-5s) later, after the OUT_OF_RANGE error.
I managed to figure it out, when user signals end of transmission, instead of building another StreamingRecognizeRequest with new audio data, I call requestStream.onCompleted()
. This let's google service know there will be no more data and it will send the "final" result back quickly, and I don't get the OUT_OF_RANGE exception any more.
I was facing this issue while using
streamingRecognizeCallable()
(in Kotlin), after the user signalled end of audio by clicking button, I just stopped audio emitter and thus stopped streaming sound data to recognition service. While the interim results were good, the "final=true" result was received only several seconds (like 3-5s) later, after the OUT_OF_RANGE error.I managed to figure it out, when user signals end of transmission, instead of building another StreamingRecognizeRequest with new audio data, I call
requestStream.onCompleted()
. This let's google service know there will be no more data and it will send the "final" result back quickly, and I don't get the OUT_OF_RANGE exception any more.
Hello ped, i am also facing similar issue it would really help full if you can throw some sample. thanks in advance
Hello ped, i am also facing similar issue it would really help full if you can throw some sample. thanks in advance
I have similar code to this example, here in the "bytes ->" callback, I test new class variable mUserRequestedStop
(set to true
in new onPause
function, which I call when I know the audio stream from mic should be ended, like the user does tap the mic-off button or app goes to background):
mAudioEmitter?.start { bytes ->
if (mUserRequestedStop) {
// ensure mic data stops
mAudioEmitter?.stop()
mAudioEmitter = null
// and give nudge to SpeechToText service that this is all done
requestStream.onCompleted()
return@start
}
Before I was only stopping the audio emitter (stop() call), which leads to OUT_OF_RANGE timeout error in recognizer.
edit: now I see they do this mAudioEmitter?.stop()
in the example in the Activity.onPause, but they don't call the onComplete
on the request, so this example will also cause the OUT_OF_RANGE errors when you put its activity into background while it is listening.
I guess one way is to extract recognition requestStream
as class property and call onCompleted
in the onPause
, or add boolean flag like I have, and let it stop in the next data callback (which happens every few milliseconds when new audio data are available, so the real pause will be delayed only 100-200ms maybe).
Thanks Ped,
for your quick response will work on it.
Thanks Ped it worked.
07-25 18:15:52.504 12312-12312/com.google.cloud.android.speech D/HwCust: Create obj success use class android.widget.HwCustTextViewImpl 07-25 18:15:52.504 12312-12312/com.google.cloud.android.speech D/HwCust: Create obj success use class android.widget.HwCustTextViewImpl 07-25 18:15:52.784 12312-12735/com.google.cloud.android.speech I/SpeechService: API completed. 07-25 18:16:23.064 12312-12735/com.google.cloud.android.speech I/SpeechService: API completed. 07-25 18:16:53.034 12312-12735/com.google.cloud.android.speech E/SpeechService: Error calling the API. io.grpc.StatusRuntimeException: OUT_OF_RANGE: Audio data is being streamed too slow. Please stream audio data approximately at real time. at io.grpc.Status.asRuntimeException(Status.java:543) at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:395) at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426) at io.grpc.internal.ClientCallImpl.access$100(ClientCallImpl.java:76) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:512) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:429) at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:544) at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:52) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:117) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:833) 07-25 18:17:09.484 12312-12312/com.google.cloud.android.speech V/AudioManager: preDispatchKeyEvent keycode: 4 stream: -2147483648 07-25 18:17:09.564 12312-12312/com.google.cloud.android.speech V/AudioManager: preDispatchKeyEvent keycode: 4 stream: -2147483648 07-25 18:17:10.084 12312-12312/com.google.cloud.android.speech I/View: ssignParent(ViewParent parent) parent is: null 07-25 18:17:10.094 12312-12312/com.google.cloud.android.speech I/View: ssignParent(ViewParent parent) parent is: null