My brain has leaked out my ears trying to figure this out and I can't seem to find a good example to base my code off of.
I'm simply trying to fade down one piece of background music before i start another one, so that I don't end up with a "hard" stop. I found a topic that posted an example like:
[CDXPropertyModifierAction fadeBackgroundMusic:2.0f finalVolume:0.0f curveType:kIT_Exponential shouldStop:YES];
to fade one piece of music out, and that works fine. The issue is that when I go to start a new piece of music, I'm first fading the current music down, then starting the new one. What happens is the first one fades, but the action doesn't finish running before the next one starts, so the next one "clicks" and then never starts. Watching the log confirmed that the action is still running before the second starts.
I've tried everything I can think of to "wait" before starting the second piece, but nothing seems to work. I've tried watching IsBackgroundMusicPlaying, but that seems to register "YES" even after the first piece has stopped and is in "loaded" state. I tried doing a manual wait, but that froze everything up and causes other issues in the game.
Does anyone have any suggestions, or a real code sample somewhere that shows how to do a proper crossfade between two background music files?
Thanks
Dave