Skip to content
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

Problem with MP3 output, multiple conversations ? #95

Open
kamil-kierski opened this issue May 22, 2019 · 2 comments
Open

Problem with MP3 output, multiple conversations ? #95

kamil-kierski opened this issue May 22, 2019 · 2 comments

Comments

@kamil-kierski
Copy link

kamil-kierski commented May 22, 2019

Hello guys,

I'm having problems using the androidthings example from Google, when I set output to MP3, most of the responses are working well and as expected but sometimes for example when I say "Say something short", "Say something long" the Assistant API is acting strange, I'm getting way too many responses and "conversations?"

The log says that it's finishing conversation many times, I got this event fired many times...

2019-05-22 17:28:19.323 17562-17709/com.example.androidthings.assistant 
D/AudioTrack: stop() called with 280 frames delivered
2019-05-22 17:28:19.323 17562-17709/com.example.androidthings.assistant 
I/AudioTrack: Skip ramp
2019-05-22 17:28:19.333 17562-17562/com.example.androidthings.assistant 
I/AssistantActivity: assistant conversation finished
2019-05-22 17:28:19.335 17562-17709/com.example.androidthings.assistant 
D/EmbeddedAssistant: Received response: # 

See the attached log: Embedded assistant log

Is is the API bug?
Or something's wrong with the configuration ?

I'm using the latest code from here: androidthings-googleassistant

The problem does not exist when the output encoding is set to LINEAR16.

EDIT:

I believe that this part causes problems:

if (value.getAudioOut() != null) {
   if (mAudioOutSize <= value.getAudioOut().getSerializedSize()){
   mAudioOutSize = value.getAudioOut().getSerializedSize();
   } 
   else {
   mAudioOutSize = 0;
   onCompleted();
   }
}

This was some nasty way on determining the end of the assistant response, works well for PCM because chunks were always the same size and the last was smaller, but for the MP3 the chunk sizes aren't equal, they look random.

Any better way to determine the end of audio response ?

@Fleker
Copy link
Collaborator

Fleker commented May 23, 2019

The current implementation works with the default output as configured in the sample. I don't know with regards to mp3.

@kamil-kierski
Copy link
Author

kamil-kierski commented May 23, 2019

The current implementation works with the default output as configured in the sample. I don't know with regards to mp3.

That's right. It's not a bug of the implementation. Please move it to questions as it is a question regarding modification of this implementation.

Regards,
Kamil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants