How to play sound on Mac OS?

I want to play the .mp3 file in an Objective-C application intended for use on Mac OS X Lion 10.7, not iPhone. Thank!

+5
source share
1 answer

Take a look at the NSSoundclass:

NSSound *sound = [[NSSound alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mySound" ofType:@"mp3"] byReference:NO];
[sound play];
[sound release];
+20
source

All Articles