很简单... 我的游戏中有一首背景音乐正在播放,我想交叉淡入淡出一首曲目,而不是突然停止。
//Prep Background Music
if (![[SimpleAudioEngine sharedEngine]isBackgroundMusicPlaying]) {
[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"song.mp3"];
}
[[SimpleAudioEngine sharedEngine] setBackgroundMusicVolume:1.0];
//Play Background Music
if (![[SimpleAudioEngine sharedEngine]isBackgroundMusicPlaying]) {
[[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"song.mp3" loop:YES];
}