iPhone如何调用系统声音?

来源:互联网 发布:域名备案 编辑:程序博客网 时间:2024/06/12 01:44

问题:
如何调用系统声音?
答案:
首先要在工程里加入Audio Toolbox framework这个库,然后在需要调用的文件里

(AudioToolbox.framework)

#import 

1#import<AudioToolbox/AudioToolbox.h>

最后在需要播放提示音的地方写上
1AudioServicesPlaySystemSound(1106);

注:括号中为系统声音的id,详见http://iphonedevwiki.net/index.php/AudioServices


----------------------------------------------------------------------------------------------------------------------------------------------------


【原文及参考:http://www.devdiv.com/iOS_iPhone-_q_amp_a_-thread-127736-1-1.html】


1.声音各文件见:http://blog.csdn.net/xiaohei5188/article/details/8888660

2.调用系统提示音教程http://www.cocoachina.com/iphonedev/sdk/2011/1009/3332.html