Reputation: 809
I want to play a .mp3 file in an Objective-C app being designed for use on Mac OS X Lion 10.7, not for the iPhone. Thanks!
Upvotes: 6
Views: 3468
Reputation: 53930
Take a look at the NSSound class:
NSSound
NSSound *sound = [[NSSound alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"mySound" ofType:@"mp3"] byReference:NO]; [sound play]; [sound release];
Upvotes: 21