views:

32

answers:

1

How to play an mp3 file, on repeat, on OS X 10.5 or higher?

Please reply with a code snippet. Thanks.

+1  A: 
NSSound *sound = [[NSSound alloc] initWithContentsOfURL:url byReference:YES];
[sound setLoops:YES];
[sound play];
// Later, when finished with sound
[sound release];
sbooth
Thanks! for anyone interested, if you need to load the file from the application bundle: NSSound *sound = [NSSound soundNamed:@"FILENAME.mp3"];
Steph Thirion