Streaming Audio Graphic Equalizer

One of the programs I eventually want to write is a visual representation of the output of streaming audio coming from the sound card. I am early on and have NO idea how to achieve any of this yet. I guess what I am asking is someone to point me in the direction of the resources tailored to this sort of project, articles, reference materials, library functions recommended, sound card properties and manipulations. so on and so forth. I want to familiarize myself with the requirements I need and implement this as a side project and develope it as I continue to learn C++. I am REALLY hoping to get some feedback on this topic. Thank you in advance..
What do you mean by "audio coming from the sound card"?

Do you mean stuff being picked up by the mic? Or stuff being played by your program? Or stuff being played by other programs?
I would initially like to use it for streaming audio coming from other programs, the first and foremost that comes to mind is the output of the stereo mixer, with equalizer capabilities, and like I mentioned above, a visual representation, such as bars or other manipulations, Ive seen some neat waterfall graphics on some programs, and some of the bar representations ive seen have been top notch,, I think it would be a fun project to work on.
I'm not sure there's a way to reliably get audio output from other programs. I think it depends on the sound card/driver.

On my old Windows box, I had a "What You Hear" input option, which basically fed back all audio output to audio input, so you could record what was playing on your computer. But it was a PC setting. I had to go in my sound options, mute the mic input, and enable the "what you hear" input. I don't think there is a [practical] way to change the setting from another program. And not all computers might have that option anyway.

Assuming you have that option or want to make use of it, you'd do so just like you would taking mic input. Most audio APIs have input audio streaming (ie: "Recording") just like they have output streaming ("Playing"). So just look up how to make use of that in whatever audio API you're using (SDL, DirectSound, OpenAL, whatever)


As for the actual visualizations... oscilliscopes are the easiest, so I suggest starting with that. They're basically just plotting points based on each audio sample and connecting the dots.

Bar representations require some additional work. You'll need to run the audio through an FFT (Fast Fourier Transform -- wikipedia it, or google for libs) to transform the audio samples into frequency ranges.
thanks disch, I guess I meant play through my own program, but I will start with familiarizing myself with the audio api's and FFT applications in the meantime. its a good start.
Last edited on
Well if you want to start easy, start with loading/streaming a wav file. These are easy because there's no compression, so you only need a lib for the audio output (use WinAPI's waveOut, or SDL, or whatever you want).

Then add a oscilloscope visualization since that's the easiest, since it requires minimal processing on the audio data.

After that, you can move to a bar display (requires FF transform) which is a bit trickier.

etc.
ok! that sounds perfect for me to start out with, thank you very much Disch
Last edited on
Disch, which API would you recommend?
Last edited on
If I can pipe in ('http://cplusplus.com/forum/beginner/18012/ | chris'); I'd recommend SDL for drawing the sine wave (if that's what you're drawing) and again SDL for the sound I/O. While WinAPI may be faster on windows, SDL is cross-platform.
Thanks Chris!! I just finished downloading and installing Cygwin and downloading SDL & Open AL(but havnt installed yet)
Last edited on
Topic archived. No new replies allowed.