AVAudioPlayer
Hey, I'm making a drum machine app and I've came across a problem.
Each drum pad in my app has its on AVAudioplayer as a property. When the user touches one of the drum pads, the drum pad object tells its AVAudioplayer to play. Here's the problem, if the user touches the drum pad then quickly touches again all I can do is set the current play time back to 0, But that doesn't sound like a realistic drum set. What I would like to do is play the same sound over the top of the currently playing sound.
I thought of doing it like this. When the pad is touched, check to see if its AVAudioplayer is playing, if so, create a new AVAudioplayer with the same sound and play that.
There must be a better way of doing this tho. Any ideas?
Thanks in advance.
|