1
多個音頻文件在我的應用程序,我展示的行和列的多張圖片時,我一個圖像上單擊我將使用如何發揮使用AVAudioPlayer
someName = [someName stringByAppendingFormat:@".mp3"];
[audioPlayer stop];
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%s", [[NSBundle mainBundle] resourcePath],[someName UTF8String]]];
NSError *error;
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error];
audioPlayer.delegate = self;
播放相應的聲音,當我點擊一個圖像我會得到特定的圖像聲音。當我點擊另一幅圖像時,先前的聲音將被停止,並且將播放與圖像相對應的新聲音。
我的要求是當我點擊聲音必須來的第一個圖像,當我點擊第二個圖像時,第一個聲音不能停止,都必須播放,當我點擊第三個聲音必須播放。
請幫我