diff --git a/audio/internal/driver/driver_android.go b/audio/internal/driver/driver_android.go index 33db9a056..e2ea0e317 100644 --- a/audio/internal/driver/driver_android.go +++ b/audio/internal/driver/driver_android.go @@ -255,17 +255,16 @@ func NewPlayer(sampleRate, channelNum, bytesPerSample int) (*Player, error) { } func (p *Player) Proceed(data []byte) error { - select { - case err := <-p.chErr: - return err - default: - } p.buffer = append(p.buffer, data...) if len(p.buffer) < p.bufferSize { return nil } buf := p.buffer[:p.bufferSize] - p.chBuffer <- buf + select { + case p.chBuffer <- buf: + case err := <-p.chErr: + return err + } p.buffer = p.buffer[p.bufferSize:] return nil }