Closed vladkorotnev closed 7 hours ago
This is correct: the FormatConverter only supports signed data types and the output of 8 bit via the ESP32 I2S is even messier because it expects an int16_t where the signed audio byte is left shifted by 1 byte.
You can chain another EncodedAudioStream with a DecoderL8 which supports both signed and unsiged bytes to convert it into a proper stream of int16_t
Oh, that's good to know. I have to admit this was on a whim and somehow didn't come up to this decoder via Google. So went with the good ol' peek and poke approach :-) Thanks for the pointer!
The esp was already decapitated and submerged into epoxy but it's good to know for later! Thanks so much!
P.S.
t expects an int16_t which is left shifted by 1 byte. The deeper I dive into this platform the more I am reassured it is cursed by design...
Problem Description
Thanks for the nice project, it saved me in a pinch :-) (quickly upcycling an ESP32 with a fried LNA output into an audio toy for a friend's kid)
However I've encountered an issue with the resampling code: When playing a WAV file which is saved as 8 bits PCM via a FormatConverterStream, it is very noisy and distorted.
The reason seems to be because the samples are interpreted as signed 8 bit integers, which are not part of the WAV standard.
Device Description
ESP32 WROVER, but I think it's not device specific
Sketch
Other Steps to Reproduce
The following patch for
AudioStreamsConverter.h
fixes it, but breaks all other formats of course without proper integration:What is your development environment
ESP32 + PlatformIO (espressif32 + arduino latest)
I have checked existing issues, discussions and online documentation