如何在iPhone游戏中播放背景音乐? [英] How do I play background music in my iPhone game?

查看:146
本文介绍了如何在iPhone游戏中播放背景音乐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

iPhone / iPad - 循环背景音乐?

官方iphone文档也不错,但我发现它们对这个主题非常无益 - 我只能找到一个用于播放midi文件的API,但这不是我想要的。我只想在后台播放MP3。
如果用户已经在播放他们自己的音乐,显然我不想在它上面播放我自己的音乐。

The official iphone docs aren't bad, but I'm finding them pretty unhelpful on this subject - all I can find is an API for playing midi files, but that's not what I want. I just want to play an MP3 in the background. And if the user is already playing their own music, obviously I don't want to play my own on top of it.

是否有正确 这样做的方法是什么?

Is there a "correct" way to do this?

推荐答案

SDK中的CrashLanding演示应用程序有一个可以播放背景音乐的SoundEngine类。

The CrashLanding demo app in the SDK has a SoundEngine class that can play background music.

这篇关于如何在iPhone游戏中播放背景音乐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆