O'Reilly logo

openFrameworks Essentials by Denis Perevalov, Igor Tatarnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the level of sound for a parameter's automation

Real-time analysis of sound lets us create audio-reactive visuals. It is an important part of any video synthesizer. Here, we consider the simplest case of analysis—getting the level of sound and using it to control a parameter of our project.

We consider two ways of getting a sound: by playing an audio file and by capturing a sound from the sound card's input.

Playing and analyzing an audio file

openFrameworks has a powerful class for audio file playback, called ofSoundPlayer. It loads an audio file of various formats, including MP3, WAV, and AIFF, plays it, and controls its basic parameters, such as volume, pan, and speed.

Let's use this class to play an audio file by performing the following ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required