第一步:引进#import <AudioToolbox/AudioToolbox.h>
第二步:获取路径
NSString *path=[[NSBundle mainBundle]pathForResource:@"duanxin7.caf" ofType:nil];
NSURL *url=[NSURL fileURLWithPath:path];
SystemSoundID soundID=1;
第三部: 创建获取id
AudioServicesCreateSystemSoundID((__bridge CFURLRef)(url), &soundID);
第四部:播放
AudioServicesPlaySystemSound(soundID);