ESP32 Audio Decoding inquiry
Xasin wrote 09/09/2020 at 21:08 • 1 pointHey guys!
I was wondering if anyone here has had any experience using an audio stream de/encoder on the ESP32
Some of my future and current projects could really be enhanced by having something like Opus on the ESP to store higher quality audio without filling the entire memory with raw samples, as well as streaming, and instead of delving in head-first making my own things work, I wanted to see if anyone had something ready!
I am aware that there is the ESP-ADF (Audio Development Framework), but I'd feel much more comfortable with something standalone that integrates into the regular IDF and provides only one or two encodings - something like Opus would be enough.
If not, I'll probably just go ahead, take the open source Opus codec and try to get it to compile in Fixpoint mode, but I am worried that there might be some optimizations I would miss out on by taking the platform-unspecific library instead of something written more with the ESP's core in mind.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Just FYI, for those still interested in this:
Opus does work on the ESP32 without too many modifications! Decoding seems to require 20% CPU at 240MHz even at higher qualities and is quite achievable!
Encoding seems to not work well though, and anything above 24kHz and complexity level 2 will kill one of the cores. That's still perfectly fine for some VOIP applications though, and if you know how to handle the two cores of the ESP should be fine~
https://github.com/XasWorks/esp-libopus
((Still WIP but we'll get there))
Are you sure? yes | no
Well, you might take the easy route and hook up a VS1053 to your ESP32.
Are you sure? yes | no
I don't have experience to share with you sadly but I would like to draw your attention to Codec2 if you haven't already considered it.
There's a recent hackaday.io project that looks at it (on a more powerful chip that the esp32 iirc) https://hackaday.io/project/174231-digital-walkie-talkie
But it has been done on an stm32f. It would be great to see some good codecs for low bitrate voice start to be implemented in open source projects. https://github.com/drowe67/codec2/tree/master/stm32
Are you sure? yes | no
Codec2 looks pretty neat actually, but I think it's a bit too low bitrate for me, with the highest setting being around 3200 bit/s. I wanted to use this for general purpose transmission potentially of music as well... But this would be great for more constrained applications, so thanks a lot for sharing!
Might add this to some other projects that focus more on voice :>
Are you sure? yes | no
Please would you let me know if you do use codec2 for anything else? I'm not as familiar with the st side of things so I can't tell how hard it would be to port from browsing the repo. I think the results from the upper end bitrates of codec2 can seem competitive with higher bitrate alternatives (for voice).
Are you sure? yes | no
I will!
You can follow my "Tap Badge" or "DSKorder" projects, both of those will be my testing ground if I do try to use this (or other) codecs.
If everything goes well I might build my own small ESP32-based internet radio or something similar by Christmas :>
Are you sure? yes | no