Git Product home page Git Product logo

Comments (16)

davehorton avatar davehorton commented on July 24, 2024 1

ok, thanks that was helpful. It looks like google simply limits the length of a long-running recognize operation. Perhaps I just need to respond to this error under the covers by starting another one, or else send an event to the application so that it can restart it. Let me think about that.

By the way, note the GOOGLE_SPEECH_SINGLE_UTTERANCE channel variable option -- not sure of your use case, but if you are doing a command and response type of use case, you may want to use this. If you are just wanting to transcribe a complete phone call or something, then the current way you are doing it is better.

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

could you turn freeswitch log levels to debug and recreate, then send me the (entire) log? Feel free to either send me a link to a private gist or email it to me directly

from drachtio-freeswitch-modules.

viktorsperl avatar viktorsperl commented on July 24, 2024

This also happend to me. Only these three lines are relevant in the log:

2019-08-12 15:47:59.633164 [ERR] google_glue.cpp:165 grpc_read_thread: error Exceeded maximum allowed stream duration of 305 seconds. (11)
2019-08-12 15:47:59.633164 [DEBUG] google_glue.cpp:221 grpc_read_thread: got 0 responses
2019-08-12 15:47:59.633164 [DEBUG] google_glue.cpp:231 grpc_read_thread: finish() status Exceeded maximum allowed stream duration of 305 seconds. (11)

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

OK, just wondering about the scenario where this happens. Was there literally 5 minutes with no spoken audio? Or was it five minutes with some sort of speech input, but it just wasn't recognized as an intent?

from drachtio-freeswitch-modules.

viktorsperl avatar viktorsperl commented on July 24, 2024

There was continuous speech on the call, and detection returned several transcripts correctly.
However only on one channel of the two, the other one was completely silent. Maybe I should set GOOGLE_SPEECH_SEPARATE_RECOGNITION_PER_CHANNEL on this call?

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

OK, just to confirm: you are using mod_google_transcribe, correct?

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

actually, how are the two channels arranged? Are they bridged together, and you want to transcribe each? are you calling uuid_google_transcribe on each separately?

Looking at the code, it doesn't look like I implemented support for sending two channels at once to google (and transcribing each separately) so perhaps I should implement that.

But I would like to understand how you are trying to transcribe the two channels in your app.

from drachtio-freeswitch-modules.

viktorsperl avatar viktorsperl commented on July 24, 2024

Two channels are bridged, yes. One has no mic, so no sound.
uuid_google_transcribe is started only on the channel uuid which has incoming speech.

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

ok, then I am confused. The channel that has speech -- the one you are transcribing -- was returning transcripts correctly? Or it was for a bit, and then eventually it went 305 seconds without returning a transcript?

Assuming the latter, I think all I could (should) do is to return a timeout event to your application. Do you agree?

from drachtio-freeswitch-modules.

viktorsperl avatar viktorsperl commented on July 24, 2024

The channel that has speech -- the one you are transcribing -- was returning transcripts correctly? Or it was for a bit, and then eventually it went 305 seconds without returning a transcript?

It did returned transcripts correctly, but after 305 seconds, it stopped.

A bridged call has 2 channels (uuid-s), each channel (uuid) has 2 audio streams (sent and received). As I mentioned earlier, the uuid_google_transcribe was only started on one channel, but that still means 2 audio streams. One of these contained speech, but the other one was mute. Could this be the issue?

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

no, if you called uuid_google_transcribe on a single channel, then it would be sending only the received audio on that channel to google speech.

Are you saying it returned several transcripts correctly, THEN there was a pause of 305 seconds, followed by that error? Or are you saying that 305 seconds from calling uuid_google_transcribe that error was returned, even though several transcripts were returned during that 305 seconds?

from drachtio-freeswitch-modules.

viktorsperl avatar viktorsperl commented on July 24, 2024

no, if you called uuid_google_transcribe on a single channel, then it would be sending only the received audio on that channel to google speech.

Ok ,thanks, good to know.

Are you saying it returned several transcripts correctly, THEN there was a pause of 305 seconds, followed by that error? Or are you saying that 305 seconds from calling uuid_google_transcribe that error was returned, even though several transcripts were returned during that 305 seconds?

There was no pause. I was talking, it returned the transcriptions almost continuously. It stopped 305 seconds from uuid_google_transcribe start.

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

and you got a final transcription during that time ?

I'd really like to see the entire freeswitch log (debug level) from the time of the call to uuid_google_transcribe start to the error

from drachtio-freeswitch-modules.

viktorsperl avatar viktorsperl commented on July 24, 2024

Here you go. Timestamp difference is exactly 305s.
call.log

from drachtio-freeswitch-modules.

prady77 avatar prady77 commented on July 24, 2024

Actually it is Google limitation (GSR), they recommend to refresh the grpc channel every 5 mins. i.e destroy and recreate every 5 mins.

from drachtio-freeswitch-modules.

davehorton avatar davehorton commented on July 24, 2024

OK, I (finally) have a partial fix for this -- I've addressed the issue with using google speech to text where transcriptions end after 305 seconds.

There is some work on the application side to handle this -- see the updated google_transcribe example to see a working example.

FIrst, of all, I have added a new freeswitch event (google_transcribe::max_duration_exceeded) that the application will receive when google terminates a transcription due to the 305 second limit.

The application is responsible for handling that event and restarting the transcription, as shown here.

This requires a build of mod_google_transcribe with the commit referenced above.

The similar dialogflow issue is still outstanding (probably needs a similar fix), but @prady77 if possible please test and let me know if this resolves your issue.

from drachtio-freeswitch-modules.

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.