I've started my first iPhone application and I am learning a lot along the way, but now I seem to be stuck.
For the application I am building I want to be able to play multiple audio files, and have four buttons to control playback, (Play, Pause, Next Track, and Previous track). I want the play button to start the first audio file and then play just the first file and then stop, I then want to be able to press the same play button again and then play the second file and so on. I came across what I at least thought might work well for this functionality here: http://chris-software.com/index.php/2009/05/09/playing-backgroud-music/
I got this to work and it does a great job of playing the first track and then stopping (which is what I want). I can't seem to be able to get it to add the following tracks. when I put the code in for the additional track as the instructions at the bottom of the page say:
Instead it just plays the second track instead of the first.
If anyone can figure out what I'm doing wrong I would greatly appreciate it.
Thanks.
For the application I am building I want to be able to play multiple audio files, and have four buttons to control playback, (Play, Pause, Next Track, and Previous track). I want the play button to start the first audio file and then play just the first file and then stop, I then want to be able to press the same play button again and then play the second file and so on. I came across what I at least thought might work well for this functionality here: http://chris-software.com/index.php/2009/05/09/playing-backgroud-music/
I got this to work and it does a great job of playing the first track and then stopping (which is what I want). I can't seem to be able to get it to add the following tracks. when I put the code in for the additional track as the instructions at the bottom of the page say:
Code:
[backgroundMusic close];
[backgroundMusic initWithPath:[[NSBundle mainBundle] pathForResource:@"nextTrack" ofType:@"caf"]];
If anyone can figure out what I'm doing wrong I would greatly appreciate it.
Thanks.