Skip to content

Commit 7f64af3

Browse files
committed
fix 'audiomixer_mixer_reset_buffer'
1 parent 2e4b687 commit 7f64af3

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

shared-module/audiomixer/Mixer.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ uint32_t common_hal_audiomixer_mixer_get_sample_rate(audiomixer_mixer_obj_t* sel
7777
}
7878

7979
bool common_hal_audiomixer_mixer_get_playing(audiomixer_mixer_obj_t* self) {
80-
for (int32_t v = 0; v < self->voice_count; v++) {
80+
for (uint8_t v = 0; v < self->voice_count; v++) {
8181
if (common_hal_audiomixer_mixervoice_get_playing(MP_OBJ_TO_PTR(self->voice[v]))) {
8282
return true;
8383
}
@@ -88,11 +88,9 @@ bool common_hal_audiomixer_mixer_get_playing(audiomixer_mixer_obj_t* self) {
8888
void audiomixer_mixer_reset_buffer(audiomixer_mixer_obj_t* self,
8989
bool single_channel,
9090
uint8_t channel) {
91-
#if 0
92-
for (int32_t i = 0; i < self->voice_count; i++) {
93-
self->voice[i].sample = NULL;
91+
for (uint8_t i = 0; i < self->voice_count; i++) {
92+
common_hal_audiomixer_mixervoice_stop(self->voice[i]);
9493
}
95-
#endif
9694
}
9795

9896
uint32_t add8signed(uint32_t a, uint32_t b) {

0 commit comments

Comments
 (0)