Skip to content

Commit 4f888b6

Browse files
committed
fft: fix fifo only have left channel data problem
1 parent 29bfa47 commit 4f888b6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main/src/user/audio_render.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ esp_err_t i2s_write_wrapper(i2s_port_t i2s_num, const void *src, size_t size, si
2323
uint32_t idx = 0;
2424
const uint8_t *data = (const uint8_t *)src;
2525
while (size > 0) {
26-
fifo_write(data[idx+1] << 8 | data[idx]);
26+
int16_t data_l = data[idx+1] << 8 | data[idx];
27+
int16_t data_r = data[idx+3] << 8 | data[idx+2];
28+
fifo_write((data_l + data_r) / 2);
2729
idx += 4;
2830
size -= 4;
2931
}

0 commit comments

Comments
 (0)