circuitpython/shared-module/audiomixer
Jeff Epler 0722dafc24 audiomixer: Fix garbled playback when voice 0 is stopped, audio pops
There were two main problems
 - word_buffer was being filled as though with unsigned samples,
   but during mixing all samples are kept in signed mode
 - If the first buffer was stopped, the voices_active flag got set
   anyway, even though the output buffer wasn't initialized yet,
   so the samples were mixed with indeterminate data

We also cover the case where no buffer was playing, and ensure
the output buffer is filled.

This now works much better.  Tested on neotrellis m4 playing back
4 mp3 streams at a time in signed-16, 22050Hz
2020-06-01 19:14:38 -05:00
..
__init__.c move Mixer & MixerVoice from 'audiocore' to 'audiomixer' 2019-08-24 23:36:18 -05:00
__init__.h move Mixer & MixerVoice from 'audiocore' to 'audiomixer' 2019-08-24 23:36:18 -05:00
Mixer.c audiomixer: Fix garbled playback when voice 0 is stopped, audio pops 2020-06-01 19:14:38 -05:00
Mixer.h move Mixer & MixerVoice from 'audiocore' to 'audiomixer' 2019-08-24 23:36:18 -05:00
MixerVoice.c Mixer: Rework for performance, particularly of the S16 case 2020-01-16 10:48:38 -06:00
MixerVoice.h Mixer: Rework for performance, particularly of the S16 case 2020-01-16 10:48:38 -06:00