CPU usage high when playing MP3 from LittleFS #1006
-
Hi Phil and everyone I'm playing MP3 files from LittleFS well on a ESP32 Lolin D32 over I2S using your libraries – thank you (see attachement). However, if I try to use MP3-files as sound effects in a game that I have programmed, it seems as if there is not enough CPU power. Both visuals and audio lag. I was wondering, if WAV-files would be less demanding because they are not encoded. Or would it be be possible to use one core for audio and another for the rest? Unfortunately, I wasn't able to find a WAV to I2S example, so I could not try it out. What do you think of the idea of using WAV-files? Is there an example of WAV to I2S? Thank you for pointing it out. Regards, Dani |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I don't understand why you would need a separate example for this: You would just use a different decoder! PCM WAV is much more efficient in the sense that it does not need any decoding, but we can just copy the data as is. If you are looking for an efficient compressed audio format ADPCM would be a perfect choice (e.g. in combination with WAV). |
Beta Was this translation helpful? Give feedback.
-
https://github.com/pschatzmann/arduino-audio-tools/wiki/Introduction#logging |
Beta Was this translation helpful? Give feedback.
I don't understand why you would need a separate example for this: You would just use a different decoder!
I guess it might be a good idea to use a separate core for the audio decoding of MP3: see here
PCM WAV is much more efficient in the sense that it does not need any decoding, but we can just copy the data as is. If you are looking for an efficient compressed audio format ADPCM would be a perfect choice (e.g. in combination with WAV).