预加载多个背景音乐
我正在尝试预加载一堆背景音乐文件。基本上我多次调用 preloadBackgroundMusic 。当我尝试使用 SimpleAudioEngine 时,这对我来说很困难:
[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"vitesse1.mp3"]; [[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"vitesse1.mp3"];
但是当我使用 CDAudioManager 时,当我尝试释放在我的类中声明的 CDAudioManager 对象时,我会遇到泄漏:
CDAudioManager *localAm = [CDAudioManager sharedManager];
[localAm preloadBackgroundMusic:@"vitesse9.caf"];
[localAm preloadBackgroundMusic:@"vitesse10.caf"];
[localAm preloadBackgroundMusic:@"vitesse11.caf"];
[localAm release];
任何人都可以阐明一些观点或经历类似的事情吗?
I am trying to preload a bunch of background music files. Basically i am calling preloadBackgroundMusic several times. This breaks on me when i try it with SimpleAudioEngine :
[[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"vitesse1.mp3"]; [[SimpleAudioEngine sharedEngine] preloadBackgroundMusic:@"vitesse1.mp3"];
but when I use CDAudioManager, I get leaks when i try to release the CDAudioManager object that was declared in my class:
CDAudioManager *localAm = [CDAudioManager sharedManager];
[localAm preloadBackgroundMusic:@"vitesse9.caf"];
[localAm preloadBackgroundMusic:@"vitesse10.caf"];
[localAm preloadBackgroundMusic:@"vitesse11.caf"];
[localAm release];
Anyone can shed some light or has expereinece something similiar?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能使用 SimpleAudioEngine 预加载一次背景音乐,但是您可以预加载很多效果。
you can only preload once for background Music with SimpleAudioEngine however you can preload lots of effects.