我有一个带有 MP3 文件的 AVAudioPlayer。但在演奏之前,你会听到一个障碍。这是我的代码:
NSString *geluid = [NSString stringWithFormat:@"RG_%@", nummer];
NSString *path = [[NSBundle mainBundle] pathForResource:geluid ofType:@"mp3"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate=self;
[theAudio prepareToPlay];
[theAudio play];
NSURL *url = [NSURL fileURLWithPath:path];
avplayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
[avplayer prepareToPlay];
[avplayer play];
例如:您听到“Ssstop here”,而不是“Stop here”。请帮我修复它。