1 我试了很多代码,我在这里搜索。我可以有任何音频运行代码。我想在背景中播放一个非常短的音频文件它。如何在ios 6中播放背景音频文件? 来源 2013-10-08 rahul +0 您是否已将App Plays Audio置于Info.plist所需的背景模式中?你困在哪里? – Larme +0 等待让我检查这个 – rahul +0 NSURL * musicFile = [NSURL fileURLWithPath [NSBundle mainBundle] pathForResource“winner”ofType“mp3”]]; player = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil]; [player setVolume:1.0]; [player prepareToPlay]; [玩家播放]; – rahul
您是否已将App Plays Audio置于Info.plist所需的背景模式中?你困在哪里? – Larme
等待让我检查这个 – rahul
NSURL * musicFile = [NSURL fileURLWithPath [NSBundle mainBundle] pathForResource“winner”ofType“mp3”]]; player = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil]; [player setVolume:1.0]; [player prepareToPlay]; [玩家播放]; – rahul