I have a bunch of sound clips, named sound1.mp3 through soundN.mp3. I want to randomly play them on touch, so I've set up an AVAudioPlayer for each clip which are all stored in players (AVAudioPlayer**). After I initialize everything, the only sound I can get to play is sound1.mp3. What am I doing wrong?
Thanks for the help, init code is below.
players = (AVAudioPlayer**) malloc ( sizeof (AVAudioPlayer*) * NUM_CLIPS);
NSString* path;
NSString* name;
for(uint i = 0; i < NUM_CLIPS; i++){
name = [NSString stringWithFormat: @"sound%d", i+1];
path = [[NSBundle mainBundle] pathForResource:name ofType:@"mp3"];
players[i] = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
[players[i] setMeteringEnabled:YES];
[players[i] prepareToPlay];
}