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

assistant response shouldn't be allowed to play concurrently #47

Open
proppy opened this issue Oct 25, 2017 · 2 comments
Open

assistant response shouldn't be allowed to play concurrently #47

proppy opened this issue Oct 25, 2017 · 2 comments

Comments

@proppy
Copy link
Collaborator

proppy commented Oct 25, 2017

Currently if pressing the button while the assistant response is playing, a new request will be recorded and there is a possibility that the response audio will play on top of each other.

We should either interrupt the assistant response playback or queue them.

@Fleker what do you think?

@Fleker
Copy link
Collaborator

Fleker commented Oct 25, 2017

I think if we interrupt the Assistant mid-playback, it should remove audio from the previous response. That's the behavior Google Home and other devices use.

We could put each audio sample into a queue perhaps and then wipe it. Right now we call mAudioTrack.write. Is there a way to stop the audio track or clear its internal queue?

@proppy
Copy link
Collaborator Author

proppy commented Oct 25, 2017

Sound fesable https://developer.android.com/reference/android/media/AudioTrack.html#stop():

For an immediate stop, use pause(), followed by flush() to discard audio data that hasn't been played back yet.

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