【发布时间】:2015-01-02 20:50:48
【问题描述】:
我有一个简单的代码可以通过AVAudioPlayer播放声音
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
pathForResource:@"beep"
ofType:@"mp3"]];
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
self.player.volume = 1;
[self.player prepareToPlay];
我的异常断点将停在prepareToPlay 并且控制台日志写道:
错误:AVAudioSessionUtilities.h:111:GetProperty: AudioSessionGetProperty ('prp?') 失败并出现错误:'pty?
点击 2 次通过此断点后,应用程序不会崩溃。这仅发生在模拟器中。 有什么建议吗?
【问题讨论】:
标签: ios avaudioplayer avaudiosession