Last week, I discussed my learnings in JUCE and how great the software seemed to be. JUCE is an extremely powerful audio tool, and can be used for very heavy duty applications. However, quickly after completing those tutorials, I discovered the learning curve was still extremely steep. So much so that I began to feel it could be too much for an 8-week project. My project teammate had previously mentioned SFML for use instead, so I decided to check it out and see if it could prove an easier solution.
An Intro to SFML
SFML stands for a “Simple and Fast Multimedia Library.” While it is not an audio specific library, it does have many of the basic functionality we require, with some GUI features as well. As well as this, SFML feels more like pure C++, where JUCE began to feel like it’s own language. This was a good first sign, as the work my teammate was doing was in pure C++, and therefore would be much easier to interface with SFML.
Learning About SFML Audio Processing
Once I began looking into some SFML tutorials, it became apparent this could be the simple solution we were in search of. First, I had to make sure loading in and looping audio was easy. Using this tutorial, you can see it takes about 5 lines of SFML code to complete this. So I decided to check out adding a GUI with buttons to play, pause, and shift the pitch of the audio. While the buttons are not perfect, it took mere minutes to set these up and get working.
From this, SFML appears to be absolutely perfect and flawless for our product. However, there are some catches. SFML streams audio, but accessing and editing that stream seems to be tricky. We will likely need to edit the file, then switch the stream over to the edited file. This may prove tricky and memory-intensive. Another item we are uncertain of is just how we want to approach playing multiple loops at once. There does not appear to be a simple solution to playing multiple files, so we will need to find a way or be creative.