I’m making a game and would like to have a background loop of game music and on top of it have two different channels of sound effects. I would like to control the volume of these channels. I looked at fmod, but it was out of my budget. Now instead I’m looking at the MixerHostAudio example provided by Apple. It’s a clear example, but a bit long-winded being 1000+ lines just for playing two sounds, so I’m wondering if I should be doing something else instead.
My ideal API would look something like this:
SoundSystem *sounds = [SoundSystem soundSystemWithLoop:@"koto.mp3"];
[sounds play:@"chimes.mp3" channel:1 looping:YES volume:0.0];
[sounds fadeTo:1.0 channel:1 delay:0.5];
[sounds play:@"buddha_bell.mp3" channel:2];
You can use AVAudioPlayer for the background loop and Finch for SFX. Both are easy to work with. You’d have to write the channel volume control above Finch yourself, but that’s not hard either, being just an array of sounds with a common volume control.