Code Monkey home page Code Monkey logo

Comments (8)

broady avatar broady commented on May 28, 2024

Which sample? Shouldn't need to make any modification like this.

from golang-samples.

mattetti avatar mattetti commented on May 28, 2024

Here is the sample I had issues with https://github.com/GoogleCloudPlatform/golang-samples/blob/01f58b1df950edfbe1ff28eff9e870fabe6790fc/speech/livecaption/livecaption.go

from golang-samples.

broady avatar broady commented on May 28, 2024

Found out the problem.

Speech API supports only 60 seconds of streaming recognition:
https://cloud.google.com/speech/limits#content

googleapis/google-cloud-node#1894

We need a better error and/or docs. Either the Speech client or underlying Speech API should return a better error.

from golang-samples.

odeke-em avatar odeke-em commented on May 28, 2024

Thank you for reporting this @mattetti, I too encountered the same error, sometime late
last year but things were too noisy for me to file a bug here.

With what @broady deduced in #246 (comment), @mattetti might you be interested or have time to send a PR to fix this? If not, no biggie, it might picked up.

from golang-samples.

mattetti avatar mattetti commented on May 28, 2024

@odeke-em unfortunately I moved on and I won't be able to, but thanks a lot for offering.

from golang-samples.

danicat avatar danicat commented on May 28, 2024

@broady I'll take this one, ok? The new README already states briefly about the limits, but I could make it more explicit in this example. Also, I'll work on a better error message.

from golang-samples.

broady avatar broady commented on May 28, 2024

Sounds good. Thanks.

Not sure if you can do anything about the error message, my first thought is it should be fixed in the backend.

from golang-samples.

danicat avatar danicat commented on May 28, 2024

Ok, I've finally managed to reproduce the error... there are actually two possible scenarios:

  1. 2017/09/22 06:14:23 Could not recognize: code:11 message:"Exceeded maximum allowed stream duration of 65 seconds."
  2. 2017/09/22 06:19:46 Could not recognize: code:3 message:"Client GRPC deadline too short. Should be at least: 3 * audio-duration + 5 seconds. Current deadline is: 199.99859053990804 second(s). Required at least: 206 second(s)."

The scenario 1) seems to happen when you submit a speech fragment and it's duration added to the previous fragments is more than 65 seconds. The scenario 2) seems to happen while you are still speaking the last sentence and the stream.Recv call time outs.

The documentation says:

* Each StreamingRecognize session is considered a single request even though it includes multiple frames of StreamingRecognizeRequest audio within the stream.

I'm going to modify the README to include some notes about the limits, but maybe we could also treat those error codes (3 and 11) to give a better error message in the client itself, instead of printing the raw error message.

What do you think?

from golang-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.