-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to unpack object from 'any' field. Expected com.google.cloud.speech.v1.LongRunningRecognizeResponse, found #1038
Comments
@nnegrey Is this yours? |
I think it's mine now. Taking a quick look (still have to try this myself). The audio file has a sample rate hertz of 44100.
A problem might come up though from this page: https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1#google.cloud.speech.v1.RecognitionConfig.AudioEncoding Which states: I'm not too knowledgable on audio files, so not sure if that will solve the issue. Gonna try that out first though. |
@nnegrey Just adding my 2c on your first thoughts, this message indeed appears with wrong sampleRateHertz, but with files lesser than a minute length. |
One other possible thing I've seen on that same page above: "All encodings support only 1 channel (mono) audio. " The audio is formatted as stereo. However, I converted it and still had no success. |
So I converted the audio file to FLAC (.raw) and was able to get a transcription back. Still looking in to why the OGG_OPUS format is not working. Transcription: Ragnarok Liga da Justiça E as novidades do mundo de Star Wars 7 pendrive De hoje em diante da televisão explique de atenção protagonista Ela será Ellen Page ela vai interpretar a personagem Vânia que é meio que uma ovelha negra dentro de um grupo de super-heróis Ainda não temos detalhes de quem vai dirigir o Como está o desenvolvimento da produção dessa nova série da Netflix que deve estrear no próximo ano fica Júlio Aquino Mallet pen drive para mais novidades nos Estados Unidos a previsão é que ele consiga ultrapassar a bilheteria de 700 milhões de dólares se tornando um dos filmes que mais arrecadou dinheiro em 2017 vamos ver se ele vai conseguir superar a marca de Guardiões da Galáxia 2 e também de Mulher Maravilha 2 dos filmes de super-heróis mais lucrativos de 2017 de Liga da Justiça vemos pela primeira vez o Superman |
Was able to dig into this a bit more and finally found the issue. Turns out that underlying codec in that audio file is OGG Vorbis where the Speech API only supports OGG_OPUS |
…#1038) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.8.19` -> `2.8.20` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.20/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.20/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.20/compatibility-slim/2.8.19)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.20/confidence-slim/2.8.19)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-video-intelligence). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMTMuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIxMy4wIn0=-->
In which file did you encounter the issue?
java-docs-samples/blob/master/speech/cloud-client/src/main/java/com/example/speech/Recognize.java
Describe the issue
Using attached file as an example, upload to a bucket and try to long recognize:
java -cp target/speech-google-cloud-samples-1.0.0-jar-with-dependencies.jar
com.example.speech.Recognize asyncrecognize gs://bucket/omelete_hyperdrive.ogg
After completion, the exception:
Caused by: com.google.api.gax.rpc.UnknownException: java.lang.IllegalStateException: Failed to unpack object from 'any' field. Expected com.google.cloud.speech.v1.LongRunningRecognizeResponse, found
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:117)
at com.google.api.gax.grpc.ProtoOperationTransformers$ResponseTransformer.apply(ProtoOperationTransformers.java:69)
at com.google.api.gax.grpc.ProtoOperationTransformers$ResponseTransformer.apply(ProtoOperationTransformers.java:46)
at com.google.api.core.ApiFutures$GaxFunctionToGuavaFunction.apply(ApiFutures.java:153)
at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:239)
at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:229)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:130)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:653)
at com.google.api.gax.retrying.BasicRetryingFuture.handleAttempt(BasicRetryingFuture.java:159)
at com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.handle(CallbackChainRetryingFuture.java:134)
at com.google.api.gax.retrying.CallbackChainRetryingFuture$AttemptCompletionListener.run(CallbackChainRetryingFuture.java:114)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:653)
at com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.setResult(AbstractTransformFuture.java:245)
at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:177)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:653)
at com.google.api.core.AbstractApiFuture$InternalSettableFuture.set(AbstractApiFuture.java:90)
at com.google.api.core.AbstractApiFuture.set(AbstractApiFuture.java:73)
at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onSuccess(GrpcExceptionCallable.java:86)
at com.google.api.core.ApiFutures$1.onSuccess(ApiFutures.java:66)
at com.google.common.util.concurrent.Futures$4.run(Futures.java:1132)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:435)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:900)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:811)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:653)
at io.grpc.stub.ClientCalls$GrpcFuture.set(ClientCalls.java:487)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:465)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41)
at io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:684)
at io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:41)
at io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:392)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:475)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:63)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:557)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$600(ClientCallImpl.java:478)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:590)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
... 1 common frames omitted
Caused by: java.lang.IllegalStateException: Failed to unpack object from 'any' field. Expected com.google.cloud.speech.v1.LongRunningRecognizeResponse, found
at com.google.api.gax.grpc.ProtoOperationTransformers$AnyTransformer.apply(ProtoOperationTransformers.java:131)
at com.google.api.gax.grpc.ProtoOperationTransformers$ResponseTransformer.apply(ProtoOperationTransformers.java:67)
... 51 common frames omitted
Same error when used inside my project:
Gradle:
Tried with different files (including FLAC files) and got the same result.
P.S.: FIles under 1min duration are working fine.
omelete_hyperdrive.zip
The text was updated successfully, but these errors were encountered: