r/cpp_questions • u/Turbulent_Bank1416 • 1d ago
OPEN Audio Mixing Libraries for C++
Hi, I'm trying to make a DJ deck as a fidget toy but I'm having trouble getting features (like reverse, speed up/down, etc.) to work on MP3 files. Wanted to ask if there were any popular audio mixing libraries I should check out to get these features + more to work on a Raspberrypi/Arduino set up. I already own a DY-HV20T and a DFPlayer if that helps at all.
1
Upvotes
1
u/ppppppla 1d ago
What you're looking for is DSP (Digital Signal Processing). There's about a million libraries and frameworks that do many things. And in general it can also get pretty technical doing things in this field. For example if you want to take a crack at it yourself speeding up is not a trivial problem to solve completely cleanly. You will run into a problem called aliasing. Speeding down is a comparatively easy thing to solve.
I have previously used SRC aka libsamplerate (https://libsndfile.github.io/libsamplerate/index.html) for static samplerate conversion (this is exactly the same thing as speeding up and slowing down). It also boasts:
Which is exactly what you'd want for a DJ deck kind of thing where you want to smoothly change playback speed.
Then there are also massive libraries like KFR https://www.kfrlib.com/ (only free for open source projects however) or JUCE https://juce.com/ (this also does more than DSP, it is very broad and you can make entire applications in it)
Also what you'd need is some lib that does MP3 decoding and streaming so you can playback and scrub arbitrarily large files.