Open requireiot opened 7 months ago
Nice fix, I will check your fork. Thank you for the effort!
The code in my fork has 2 changes compared to the original, which maybe I shouldn't have checked in together, but too late now:
Inmp441Max98357a.hpp
more consistent: all pin numbers etc. pertaining to the microphone I2S port start with MIC, all pin numbers etc. pertaining to the speaker I2S port start with SPK, and the config structs in Inmp441Max98357a::init()
end with _mic or _spk, resp. -- just made it easier for me to wrap my head about what pertains to what
With the Inmp441Max98357a device, the audio input (microphone signal) is distorted, because each sample is sent twice (apparently, this is what the ESP32 API will do, when 16 bit resolution is requested).
To illustrate, I recorded the streamed signal while playing a loud 440 Hz tone through a PC speaker, the read the resulting WAV file in Audacity. Below are screenshots from Audacity, from the zoomed WAV signal, amplified by 6 dB for clarity.
This was compiled with platform Espressif 32 (4.2.0) for an "Espressif ESP32 Dev Module", framework framework-arduinoespressif32 @ 3.20002.220503 (2.0.2)
With the original code
With modified code, using 32 bit samples
The modified code is in my fork of the original code. I'm not a Github expert, I guess I'll have to figure out how to do a pull request ...