How can I play a music such that it automatically replay it after its end?

Posted by iSharreth on Stack Overflow See other posts from Stack Overflow or by iSharreth
Published on 2010-04-01T06:58:57Z Indexed on 2010/04/01 7:03 UTC
Read the original article Hit count: 332

AVAudioPlayer *myExampleSound;

NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"myaudiofile" ofType:@"caf"];

myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];

myExampleSound.delegate = self;

[myExampleSound play];

How can I play myExampleSound such that it automatically replay after its end?

Anyone please help.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk