diff options
| author | Jeff Epler <jepler@gmail.com> | 2019-11-25 10:59:21 -0600 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2019-11-25 10:59:59 -0600 |
| commit | 8f4bab2d2478719450fb6ddb2b695709388add69 (patch) | |
| tree | 37797a5c28fd5ee63ec6a66a8678dabb15334f46 | |
| parent | c9946dfd63c642fc5378b222b33171f5607fc324 (diff) | |
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.
| -rw-r--r-- | ports/nrf/common-hal/audiobusio/I2SOut.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ports/nrf/common-hal/audiobusio/I2SOut.c b/ports/nrf/common-hal/audiobusio/I2SOut.c index 04c415196..459035660 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; |
