I have an audio file that is 2 seconds long. Im trying to play that many times before it is done playing. But when I try it with AVAudioPlayer by creating a new instance of it, it sounds like it stops the audio that was played before and plays the new one instead of playing them at the same time. Should I use another way to play sounds or is this not achievable?
Code:
NSURL *url = [[NSBundle mainBundle] URLForResource:@"PistolShootSound" withExtension:@"mp3"];
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
[audioPlayer play];
audioPlayer is declared in the header file.