【发布时间】:2012-08-13 06:21:31
【问题描述】:
NSString *path = [[NSBundle mainBundle] pathForResource:@"hit-pipe" ofType:@"wav"];
audioPlayer =[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:path] error:nil];
[self.audioPlayer setDelegate:self];
[self.audioPlayer prepareToPlay];
[self.audioPlayer play];
第一次加载声音需要一些时间。
【问题讨论】: