我正在为 iPod 构建一个应用程序。运行它时,本机 iPod 音乐应用程序应继续在后台播放,但这并没有发生。
我认为这可能与我的应用程序播放的声音有关。为了在某个点播放短声音,我使用的是 AVAudioPlayer。代码如下所示:
NSString *path = [[NSBundle mainBundle] pathForResource:@"sound" ofType:@"mp3"];
NSLog(@"%@", path);
player = [[AVAudioPlayer alloc] initWithData:[NSData dataWithContentsOfFile:path] error:nil];
[player prepareToPlay];
[player play];
这会干扰 iPod 上的本地音乐播放器吗?还有一件事。在我的应用程序中,我集成了 AdWhirl,它似乎使用了 AudioToolbox。
非常感谢,乔治