Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
CocosDension 的 SimpleAudioEngine 提供了循环背景音乐的方法。但一次只能播放一个音乐文件。我需要循环多个声音文件。有没有一种简单的方法可以使用 Cocos 2d 的 CocosDension 来实现这一点?
如果您使用 CDSoundSource,您可以设置是否要循环播放声音。是的,为每个声音定义一个 CDSoundSource 并独立播放。
检查 CocosDenshion 文件夹中的示例,特别是 FadeToGrey/TheAudioCode 类。
您还可以使用
SimpleAudioEngine::playEffect(soundfile, true)
这将循环播放效果