From cc3e4431599de81f82d5f5039443825c071bc599 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 28 Aug 2020 19:59:28 +0100 Subject: IT WORKS NOW! it was (almost) all a problem of signed vs unsigned --- esp32/lego-piano.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esp32/lego-piano.ino b/esp32/lego-piano.ino index 120792e..01b3bb7 100644 --- a/esp32/lego-piano.ino +++ b/esp32/lego-piano.ino @@ -160,7 +160,7 @@ void loop() { // we don't want to drop an element from the buffer if we then // can't write it! so we peek at the buffer, try to write, and pop // if successful - value=buffer[0]; + value=buffer[0] + 32768; // tsf produces *signed* shorts, i2s wants *unsigned* i2s_write(i2sPort, &value, sizeof(value), &written, 0); if (written > 0) buffer.pop(value); } -- cgit v1.2.3