Creating & Destroying Audio

My original post is below, but I’ve tested it in a fresh project and just changing the volume doesn’t cause crackling. So it must be because I’m creating and loading an ofFmodSoundPlayer every time I start playing sound and then destroying it when it’s done.

Maybe this is premature optimization but I assumed it was a good idea because I could have up to five ofFmodSoundPlayer being used at once, but as little as zero.

I can try to add a small delay between loading and raising the volume. Any other ideas?

I’m using ofFmodSoundPlayer to start and stop various wav files dynamically. To get rid of crackling when starting/stopping, I need to gradually increment the changes in amplitude across each of the 44100 samples. But how do I do this in oF? Is there a way to get the output of ofFmodSoundPlayer into the ofSoundStream’s buffer / audioOut method?

It’s been suggested to me elsewhere to use ofxPD and I’m sure there are other audiocentric add-ons… but for something this simple, it’d be nice to know how to do it without an add-on.