Mixing sounds with the sound stream API

I’m much more comfortable with graphics programming than the audio stuff, so I wonder if anyone can help.

Basically I’m using spot sound effects and was originally going to just use samples saved from sfxr with the sound player API but then I thought “why not just use the sfxr sourcecode to generate the sounds dynamically?”

I’m trying to figure out how to go about mixing generated sounds with the raw audio stream stuff so I can play more than one sound at once. Do I just keep track of several buffers and then mix them in the audioRequested callback? How do I do the mixing - just average them?

I took a look at maximilian but with my lack of audio processing experience I’m not quite sure what’s going on.

basically you can simply sum sample by sample the buffers of the sounds you want to mix; I posted some sample code on the forum 1 or 2 months ago that could get you started

Great, thanks. I’ll take a look at it ( http://forum.openframeworks.cc/t/multiplay-from-buffer-through-the-audiorequested/4604/0 ) later.