#import <AudioToolbox/AudioToolbox.h>
AVAudioSession *session = [AVAudioSession sharedInstance];
[session setCategory:AVAudioSessionCategoryPlayback error:nil];
OSStatus propertySetError = 0;
UInt32 allowMixing = true;
propertySetError = AudioSessionSetProperty (
kAudioSessionProperty_OverrideCategoryMixWithOthers,
sizeof (allowMixing),
&allowMixing
);
NSError *activationError = nil;
[session setActive:YES error:&activationError];
// Now play the sound in filePath
NSURL *fileUrl = [NSURL fileURLWithPath:filePath];
NSError *error;
AVAudioPlayer *player = [[[AVAudioPlayer alloc] initWithContentsOfURL:fileUrl error:&;error]autorelease];