不会打我使用播放声音的代码是这样的:声音在按下按钮
NSString *soundFilePath = [NSString stringWithFormat:@"%@/%@.m4a", [[NSBundle mainBundle] resourcePath],currentSound.soundNameID];
NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:nil];
player.numberOfLoops = 0;
[player play];
我想播放声音,但它不会玩。我的文件是m4a
类型。
你能播放其他声音文件吗?你可以打印你的soundFileURL。 – Divyu