Skip to content

Commit 8f4bab2

Browse files
committed
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.
1 parent c9946df commit 8f4bab2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ports/nrf/common-hal/audiobusio/I2SOut.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ void common_hal_audiobusio_i2sout_play(audiobusio_i2sout_obj_t* self,
240240

241241
uint32_t max_buffer_length;
242242
bool single_buffer, samples_signed;
243-
audiosample_get_buffer_structure(sample, /* single channel */ false,
243+
audiosample_get_buffer_structure(sample, /* single channel */ true,
244244
&single_buffer, &samples_signed, &max_buffer_length,
245245
&self->channel_count);
246246
self->single_buffer = single_buffer;

0 commit comments

Comments
 (0)