I have some songs in a plist and want to play them one after the other using AVAudioplayer. But when the first song ends it stops. How do I start the player with next song? I have tried a loop which counts to next number in the plist but it does not work. The player stops after first round. This should be simple but how? This is parts of my code. Is it is possible to use a loop as I do?
NSString *soundsPath = [[NSBundle mainBundle] pathForResource:@"soundslist"
ofType:@"plist"];
soundsList = [[NSArray alloc] initWithContentsOfFile:soundsPath];
for (int n = 1; n<=5;n++) {
NSString *filename = [soundsList objectAtIndex:n]; //n is number in plist, counting upwards in a for...loop
NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:@"au"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: path];
sound = [[AVAudioPlayer alloc] initWithContentsOfURL : fileURL error:nil];
sound.delegate = self;
}