Closed apiel closed 1 year ago
I am not really sure what you mean with bad quality, but in any case I recommend to leave the log level at warning and change it to info if you need to check the processing.
If you want to use filters I suggest to use the functionality of the AudioTools: https://github.com/pschatzmann/arduino-audio-tools/wiki/Filters together with the AudioKitStream class.
Here are some more Filter examples: https://nbviewer.org/urls/pschatzmann.github.io/Resources/jupyter/JupyterNoise.ipynb
Hard to describe bad sound quality but If I plug my synth directly to the speaker the sound is much better. If I pass through the ESP32 it feel like there is some sound lost and a bit of noise. I tried also to power to the board with powerbank but it make no difference. I changed the log output to warning and tried different sample rate, but no difference :-/
This is just a guess, but maybe this comes from the microphones which can not be switched off. I am just using some cheap pc speakers, so I would not hear the difference...
Anyhow I do not think that this is related to my software, so I am closing this issue.
Did you try to adjust the input gain ?
I tried the example from AudioTools, it's getting even worse :p Maybe I should solder away the microphone ^^
But hang on, I am actually surprise that reading and writing the audio signal happen in the main loop. It's not common way of doing audio processing (or at least from what I have seen so far). Wouldn't it be better to use timer interrupt for this and to run it in IRAM_ATTR
?
I was implementing something like that for PWM audio https://github.com/apiel/kick23/blob/main/src/boards/esp32c3_main.h#L68
Absolutly not: The ESP32 I2S API is doing this in the background using DMA. You just need to make sure to keep the buffers filled...
I am planning to implement an audio filter using my esp32 audio kit (v2.2 ESP32-A1S 2974)
When I am simply trying to forward audio input directly to output, I am getting very bad quality sound. Is there anyway to improve this?
Full repo example https://github.com/apiel/esp32-filter-effect