google-assistant icon indicating copy to clipboard operation
google-assistant copied to clipboard

Break audio up into chunks before sending to google

Open albertreed opened this issue 6 years ago • 2 comments

This change addresses the error: Conversation Error: { Error: 3 INVALID_ARGUMENT: Invalid 'audio_in': audio frame length is too long. that results from trying to send chunks of audio that are too long.

albertreed avatar May 16 '18 23:05 albertreed

@albertreed @endoplasmic Even though I like the effort in helping the community by solving this issue, I don't think we should implement this within the library itself but should be done outside of the library, or make it an optional route limit the frame length.

Like we're discussing here in the referenced issue, google is probably talking about sample-frames instead of actual bytes in size that you're sending through to Google. (I'm not sure if this is the same or not)

--

As of this PR, there's a million way to process audio and whole libraries to do that for you so I think we should limit or at least separate audio processing from this library. Other applications using this library, who do their own processing, might get into problems if this update PR gets merged.

It's always good to do research on how google exactly wants their audio so let's continue this discussion and see what other people think and what else we can figure out to optimize this!

ItsWendell avatar May 18 '18 16:05 ItsWendell

This PR doesn't process the audio - it just formats it to be compatible with google's API.

albertreed avatar May 18 '18 16:05 albertreed