A simple wrapper around the ofSoundPlayer class

#1

Hi, I have made this simple wrapper around the ofSoundPlayer object that makes FFT analysis and gives you back 3 values, respectively for low band, middle band and high band. It comes with a GUI where you can select the band range. There is also a GUI to change the speed, play and stop the audio file.

It works in simple scenarios where sound analysis does not need to be too much sophisticated.

Audio.cpp (3.9 KB)
Audio.h (1.6 KB)

A simpe usage example is:

void ofApp::setup(){
    audio.setup("Matmos-regicide.mp3");
    gui.add(audio.params);
}

void ofApp::update(){
    audio.update();
}

void ofApp::draw(){
    if (debugAudio) {
        audio.draw();
        gui.draw();
    } else {
        ofDrawCircle(200, 200, audio.getLow() * 100);
    }
}
3 Likes