您的位置:首页 > 其它

系统提示音的使用

2015-10-21 10:45 246 查看
1.1系统提示音创建

<span style="white-space:pre"></span><p style="margin-top: 0px; margin-bottom: 0px; font-size: 18px;"><span style="font-family:KaiTi_GB2312;"><span style="color: rgb(112, 61, 170);">SystemSoundID</span> receiveSound;</span></p>
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"receive_msg"
ofType:@"caf"];
NSURL *soundURL = [NSURL fileURLWithPath:soundPath];
OSStatus err = AudioServicesCreateSystemSoundID((__bridge CFURLRef)soundURL,
&receiveSound);
1.2 系统提示音播放

//播放声音
AudioServicesPlaySystemSound(receiveSound);


2.1 震动提示

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: