Open proppy opened 7 years ago
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?
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.
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?