SystemSoundIDsound;
NSString*path = [NSStringstringWithFormat:@"/System/Library/Audio/UISounds/%@.%@",
@"sms-received1",@"caf"];
OSStatuserror = AudioServicesCreateSystemSoundID((__bridgeCFURLRef)[NSURLfileURLWithPath:path],&sound);
if(error!=kAudioServicesNoError)
sound=nil;
AudioServicesPlaySystemSound(sound);
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); //这个是调用系统的震动
注:@"sms-received1"是要播放的文件名称
@"caf" 播放文件的后缀