I'm having some troubles setting up this pretty easy task. I want to use AVAudioPlayer to play a sound from the commandline. No fancy windows or such.
The thing is, I need to use audioPlayerDidFinishPlaying in order to see if the sound has finished playing, but then I need to delegate the avaudioplayer to "self".
But afaik, since I don't have any window or view "self" does not exist.
How do I do this without the delegate?
Oh and btw, I use toolchain with 2.2.1 sdk under linux.
int main(int argc, char **argv)
NSAutoreleasePool *autoreleasePool = [[NSAutoreleasePool alloc] init];
NSString *pathToMusicFile = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"mp3"];
AVAudioPlayer * myMusic = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:pathToMusicFile] error:NULL];