views:

11

answers:

0

Hi,

I am using AVAudioPlayer and am trying to get it so while the user presses on the device, it continuously plays until their finger lifts up. My code is below:

NSString *audioPath = [[NSBundle mainBundle] pathForResource:@"HahahaLong" ofType:@"mp3"];
    primaryAudio = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:audioPath] error:nil];
[primaryAudio play];

And this happens on touch down (for the UIButton). Thanks,

Alex