我正在开发iPhone应用程序。在这个应用程序中,我使用AVAudioPlayer播放音频。 这是我播放声音的代码。AVAudioPlayer不能在iPhone 5中工作
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
resourcePath = [resourcePath stringByAppendingString:@"/sound.mp3"];
NSError* err;
player_ = [[AVAudioPlayer alloc] initWithContentsOfURL:
[NSURL fileURLWithPath:resourcePath] error:&err];
if(err)
{
}
else
{
[player_ prepareToPlay];
[player_ play];
int playingLoops = 0;
player_.numberOfLoops = playingLoops;
}
据沃金上除了iPhone5.While iPhone设备罚款我运行在iPhone 5上的应用程序,我得到以下错误,然后应用程序崩溃。
2012-11-26 09:02:28.484 test[728:1dd03] <0xb0081000> Error '!obj' trying to fetch default input device's sample rate
2012-11-26 09:02:28.484 test[728:1dd03] <0xb0081000> Error getting audio input device sample rate: '!obj'
2012-11-26 09:02:28.494 test[728:1dd03] <0xb0081000> AQMEIOManager::FindIOUnit: error '!dev'
这些都是奇怪的错误。我建议您查看播放器的设置字典,以确定采样率是否正确。 – Daniel
我得到了同样的问题......所有设备的作品除iPhone5.Did你修好了吗?如果(做)请告诉我~~ thx ~~ –