From 8f4bab2d2478719450fb6ddb2b695709388add69 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 25 Nov 2019 10:59:21 -0600 Subject: [PATCH] i2sout: Correctly retrieve channel_count The meaning of the "single channel" parameter is not well-documented, but in fact it seems that "true" must be passed or else the returned channel_count is always 1. This caused stereo samples to be played incorrectly. --- ports/nrf/common-hal/audiobusio/I2SOut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 04c4151962..4590356603 100644 --- a/ports/nrf/common-hal/audiobusio/I2SOut.c +++ b/ports/nrf/common-hal/audiobusio/I2SOut.c @@ -240,7 +240,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self, uint32_t max_buffer_length; bool single_buffer, samples_signed; - audiosample_get_buffer_structure(sample, /* single channel */ false, + audiosample_get_buffer_structure(sample, /* single channel */ true, &single_buffer, &samples_signed, &max_buffer_length, &self->channel_count); self->single_buffer = single_buffer;