Skip to content

Problem with MP3 output, multiple conversations ? #95

@kamil-kierski

Description

@kamil-kierski

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions