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.
This commit is contained in:
Jeff Epler 2019-11-25 10:59:21 -06:00
parent c9946dfd63
commit 8f4bab2d24

View File

@ -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;