我正在开发小游戏,但背景音乐有问题。我AVAudioPlayer
用来播放循环音乐。如下所示:
NSString *path = [[NSBundle mainBundle] pathForResource:@"background" ofType:@"ogg"];
NSError *error;
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL URLWithString:path] error:&error];
NSLog(@"%@", [error description]);
[player setNumberOfLoops:-1];
player.delegate = self;
[player play];
我在Supproting Files
文件background.ogg
中background.mp3
,background.wav
没有人玩。它有什么问题?
当我NSLog
用来打印描述错误时,我得到了:
Error Domain=NSOSStatusErrorDomain Code=1954115647 "The operation couldn’t be completed. (OSStatus error 1954115647.)"
请帮忙。