sample-googleassistant icon indicating copy to clipboard operation
sample-googleassistant copied to clipboard

Audio clipping

Open Fleker opened this issue 6 years ago • 12 comments

(Conversation carried on from #23)

@mhanuel26 you can check out this StackOverflow answer to play simple sounds on a device

Fleker avatar Sep 21 '17 22:09 Fleker

@mhanuel26 can you confirm which hardware you were using?

proppy avatar Oct 18 '17 08:10 proppy

I do have quite a horrible audio when using this project, not sure if it is a hardware or a software problem.

I am using the AIY kit with a Raspberry PI 3 running Android Things 5.1

The audio gets choppy almost every time, I tried doubling the buffer size but didn't seem to make a difference.

plattysoft avatar Nov 10 '17 10:11 plattysoft

Some more info here: I tried the AIY image and run the test sound. The speaker worked fine.

It looks like a bug on the VoiceHAT driver of the speaker.

Let me know if there is something I can test to help with this.

plattysoft avatar Nov 10 '17 12:11 plattysoft

@proppy Sorry for my late response, I am using the AIY google kit with raspberry pi3 and android things preview 5.1, similar to @plattysoft

mhanuel26 avatar Nov 10 '17 14:11 mhanuel26

Can you disable the LED blinking on receiving audio samples and see if that resolves your issue?

Fleker avatar Nov 10 '17 20:11 Fleker

I was having the same problem with audio clipping too. I resolved it by removing the code in the ConversationCallback method section public void onAudioSample(). During the response from the assistant, it's constantly toggling the LED on and off which was slowing down the speech,

ronjdaugherty34 avatar Nov 10 '17 20:11 ronjdaugherty34

I have also seen the behavior. Removing the code at https://github.com/androidthings/sample-googleassistant/blob/master/app/src/main/java/com/example/androidthings/assistant/AssistantActivity.java#L162 resolved it.

Perhaps it's a threading issue. I've made the change at some point in the staging repo.

Fleker avatar Nov 10 '17 23:11 Fleker

Thanks! I'l try it and let you know, but it sounds likely that the LED is the cause.

plattysoft avatar Nov 11 '17 22:11 plattysoft

Indeed it worked! I'm thinking on writing a fix for this that makes the led blink but in another way, if i do it I'll send a PR. In the meantime I suggest disabling the blinking. A lot of this kits started shipping past week and it will be very annoying if people keeps finding this issue.

plattysoft avatar Nov 12 '17 19:11 plattysoft

There is the change in staging, but it has not been pushed yet. Though the issue seems to be handled, this issue will remain open until the changes are public.

Fleker avatar Nov 12 '17 19:11 Fleker

I actually sent a PR just now for another blinking solution :) Will check staging branch. Thanks

plattysoft avatar Nov 12 '17 20:11 plattysoft

There's a branch we have internally for changes. But we'll take a look at your PR.

Fleker avatar Nov 13 '17 01:11 Fleker