iOS给按钮添加系统声音
//在 工程下的target - Build Phases --Link Binary With Libraries --添加AudioToolbox.framework //然后在头文件中声明 #import <AudioToolbox/AudioToolbox.h> //声音提示 #define SOUNDID 1109
- (IBAction)voiceBtnPress:(id)sender {//一句话解决iphone ipad 声音提示 AudioServicesPlaySystemSound(SOUNDID); }
![](/assets/blank.gif)
![](/assets/blank.gif)
![](/assets/blank.gif)
/*********更多声音请参考**********/ AudioServices
AudioServices is a group of C functions in AudioToolbox for playing short (≤30 seconds) sounds. Predefined soundsThere are some predefined system sounds, for the system sound ID in the range 1000 to 2000 (decimal), as shown below (from 2.0 to 5.0 beta). The system sounds are all stored in /System/Library/Audio/UISounds/. Sound ID File name (iPhone) File name (iPod Touch) Category Note 1000 new-mail.caf new-mail.caf MailReceived 1001 mail-sent.caf mail-sent.caf MailSent 1002 Voicemail.caf Voicemail.caf VoicemailReceived 1003 ReceivedMessage.caf ReceivedMessage.caf SMSReceived 1004 SentMessage.caf SentMessage.caf SMSSent 1005 alarm.caf sq_alarm.caf CalendarAlert 1006 low_power.caf low_power.caf LowPower 1007 sms-received1.caf sms-received1.caf SMSReceived_Alert 1008 sms-received2.caf sms-received2.caf SMSReceived_Alert 1009 sms-received3.caf sms-received3.caf SMSReceived_Alert 1010 sms-received4.caf sms-received4.caf SMSReceived_Alert 1011 - - SMSReceived_Vibrate 1012 sms-received1.caf sms-received1.caf SMSReceived_Alert 1013 sms-received5.caf sms-received5.caf SMSReceived_Alert 1014 sms-received6.caf sms-received6.caf SMSReceived_Alert 1015 Voicemail.caf Voicemail.caf - Available since 2.1 1016 tweet_sent.caf tweet_sent.caf SMSSent Available since 5.0 1020 Anticipate.caf Anticipate.caf SMSReceived_Alert Available since 4.2 1021 Bloom.caf Bloom.caf SMSReceived_Alert Available since 4.2 1022 Calypso.caf Calypso.caf SMSReceived_Alert Available since 4.2 1023 Choo_Choo.caf Choo_Choo.caf SMSReceived_Alert Available since 4.2 1024 Descent.caf Descent.caf SMSReceived_Alert Available since 4.2 1025 Fanfare.caf Fanfare.caf SMSReceived_Alert Available since 4.2 1026 Ladder.caf Ladder.caf SMSReceived_Alert Available since 4.2 1027 Minuet.caf Minuet.caf SMSReceived_Alert Available since 4.2 1028 News_Flash.caf News_Flash.caf SMSReceived_Alert Available since 4.2 1029 Noir.caf Noir.caf SMSReceived_Alert Available since 4.2 1030 Sherwood_Forest.caf Sherwood_Forest.caf SMSReceived_Alert Available since 4.2 1031 Spell.caf Spell.caf SMSReceived_Alert Available since 4.2 1032 Suspense.caf Suspense.caf SMSReceived_Alert Available since 4.2 1033 Telegraph.caf Telegraph.caf SMSReceived_Alert Available since 4.2 1034 Tiptoes.caf Tiptoes.caf SMSReceived_Alert Available since 4.2 1035 Typewriters.caf Typewriters.caf SMSReceived_Alert Available since 4.2 1036 Update.caf Update.caf SMSReceived_Alert Available since 4.2 1050 ussd.caf ussd.caf USSDAlert 1051 SIMToolkitCallDropped.caf SIMToolkitCallDropped.caf SIMToolkitTone 1052 SIMToolkitGeneralBeep.caf SIMToolkitGeneralBeep.caf SIMToolkitTone 1053 SIMToolkitNegativeACK.caf SIMToolkitNegativeACK.caf SIMToolkitTone 1054 SIMToolkitPositiveACK.caf SIMToolkitPositiveACK.caf SIMToolkitTone 1055 SIMToolkitSMS.caf SIMToolkitSMS.caf SIMToolkitTone 1057 Tink.caf Tink.caf PINKeyPressed 1070 ct-busy.caf ct-busy.caf AudioToneBusy There was no category for this sound before 4.0. 1071 ct-congestion.caf ct-congestion.caf AudioToneCongestion There was no category for this sound before 4.0. 1072 ct-path-ack.caf ct-path-ack.caf AudioTonePathAcknowledge There was no category for this sound before 4.0. 1073 ct-error.caf ct-error.caf AudioToneError There was no category for this sound before 4.0. 1074 ct-call-waiting.caf ct-call-waiting.caf AudioToneCallWaiting There was no category for this sound before 4.0. 1075 ct-keytone2.caf ct-keytone2.caf AudioToneKey2 There was no category for this sound before 4.0. 1100 lock.caf sq_lock.caf ScreenLocked 1101 unlock.caf sq_lock.caf ScreenUnlocked 1102 - - FailedUnlock 1103 Tink.caf sq_tock.caf KeyPressed 1104 Tock.caf sq_tock.caf KeyPressed 1105 Tock.caf sq_tock.caf KeyPressed 1106 beep-beep.caf sq_beep-beep.caf ConnectedToPower 1107 RingerChanged.caf RingerChanged.caf RingerSwitchIndication 1108 photoShutter.caf photoShutter.caf CameraShutter 1109 shake.caf shake.caf ShakeToShuffle Available since 3.0 1110 jbl_begin.caf jbl_begin.caf JBL_Begin Available since 3.0 1111 jbl_confirm.caf jbl_confirm.caf JBL_Confirm Available since 3.0 1112 jbl_cancel.caf jbl_cancel.caf JBL_Cancel Available since 3.0 1113 begin_record.caf begin_record.caf BeginRecording Available since 3.0 1114 end_record.caf end_record.caf EndRecording Available since 3.0 1115 jbl_ambiguous.caf jbl_ambiguous.caf JBL_Ambiguous Available since 3.0 1116 jbl_no_match.caf jbl_no_match.caf JBL_NoMatch Available since 3.0 1117 begin_video_record.caf begin_video_record.caf BeginVideoRecording Available since 3.0 1118 end_video_record.caf end_video_record.caf EndVideoRecording Available since 3.0 1150 vc~invitation-accepted.caf vc~invitation-accepted.caf VCInvitationAccepted Available since 4.0 1151 vc~ringing.caf vc~ringing.caf VCRinging Available since 4.0 1152 vc~ended.caf vc~ended.caf VCEnded Available since 4.0 1153 ct-call-waiting.caf ct-call-waiting.caf VCCallWaiting Available since 4.1 1154 vc~ringing.caf vc~ringing.caf VCCallUpgrade Available since 4.1 1200 dtmf-0.caf dtmf-0.caf TouchTone 1201 dtmf-1.caf dtmf-1.caf TouchTone 1202 dtmf-2.caf dtmf-2.caf TouchTone 1203 dtmf-3.caf dtmf-3.caf TouchTone 1204 dtmf-4.caf dtmf-4.caf TouchTone 1205 dtmf-5.caf dtmf-5.caf TouchTone 1206 dtmf-6.caf dtmf-6.caf TouchTone 1207 dtmf-7.caf dtmf-7.caf TouchTone 1208 dtmf-8.caf dtmf-8.caf TouchTone 1209 dtmf-9.caf dtmf-9.caf TouchTone 1210 dtmf-star.caf dtmf-star.caf TouchTone 1211 dtmf-pound.caf dtmf-pound.caf TouchTone 1254 long_low_short_high.caf long_low_short_high.caf Headset_StartCall 1255 short_double_high.caf short_double_high.caf Headset_Redial 1256 short_low_high.caf short_low_high.caf Headset_AnswerCall 1257 short_double_low.caf short_double_low.caf Headset_EndCall 1258 short_double_low.caf short_double_low.caf Headset_CallWaitingActions 1259 middle_9_short_double_low.caf middle_9_short_double_low.caf Headset_TransitionEnd 1300 Voicemail.caf Voicemail.caf SystemSoundPreview 1301 ReceivedMessage.caf ReceivedMessage.caf SystemSoundPreview 1302 new-mail.caf new-mail.caf SystemSoundPreview 1303 mail-sent.caf mail-sent.caf SystemSoundPreview 1304 alarm.caf sq_alarm.caf SystemSoundPreview 1305 lock.caf sq_lock.caf SystemSoundPreview 1306 Tock.caf sq_tock.caf KeyPressClickPreview The category was SystemSoundPreview before 3.2. 1307 sms-received1.caf sms-received1.caf SMSReceived_Selection 1308 sms-received2.caf sms-received2.caf SMSReceived_Selection 1309 sms-received3.caf sms-received3.caf SMSReceived_Selection 1310 sms-received4.caf sms-received4.caf SMSReceived_Selection 1311 - - SMSReceived_Vibrate 1312 sms-received1.caf sms-received1.caf SMSReceived_Selection 1313 sms-received5.caf sms-received5.caf SMSReceived_Selection 1314 sms-received6.caf sms-received6.caf SMSReceived_Selection 1315 Voicemail.caf Voicemail.caf SystemSoundPreview Available since 2.1 1320 Anticipate.caf Anticipate.caf SMSReceived_Selection Available since 4.2 1321 Bloom.caf Bloom.caf SMSReceived_Selection Available since 4.2 1322 Calypso.caf Calypso.caf SMSReceived_Selection Available since 4.2 1323 Choo_Choo.caf Choo_Choo.caf SMSReceived_Selection Available since 4.2 1324 Descent.caf Descent.caf SMSReceived_Selection Available since 4.2 1325 Fanfare.caf Fanfare.caf SMSReceived_Selection Available since 4.2 1326 Ladder.caf Ladder.caf SMSReceived_Selection Available since 4.2 1327 Minuet.caf Minuet.caf SMSReceived_Selection Available since 4.2 1328 News_Flash.caf News_Flash.caf SMSReceived_Selection Available since 4.2 1329 Noir.caf Noir.caf SMSReceived_Selection Available since 4.2 1330 Sherwood_Forest.caf Sherwood_Forest.caf SMSReceived_Selection Available since 4.2 1331 Spell.caf Spell.caf SMSReceived_Selection Available since 4.2 1332 Suspense.caf Suspense.caf SMSReceived_Selection Available since 4.2 1333 Telegraph.caf Telegraph.caf SMSReceived_Selection Available since 4.2 1334 Tiptoes.caf Tiptoes.caf SMSReceived_Selection Available since 4.2 1335 Typewriters.caf Typewriters.caf SMSReceived_Selection Available since 4.2 1336 Update.caf Update.caf SMSReceived_Selection Available since 4.2 1350 - - RingerVibeChanged 1351 - - SilentVibeChanged 4095 - - Vibrate There was no category for this sound before 2.2. In the SDK this is the constant kSystemSoundI
iOS给按钮添加系统声音相关推荐
- ios 消息按钮添加角标显示
在做聊天时,其它界面的消息按钮展示,会遇到显示未读消息条数的情况. 今天整理下,处理消息角标设置方法. 直接上代码. 创建一个类 BageButton继承UIButton类,并拓展这个按钮的属性. . ...
- iOS系统声音服务(System Sound Services)
系统声音服务(System Sound Services)提供了一个接口,用于播放不超过30秒的声音.它支持的文件格式有限,具体地说只有CAF.AIF和使用PCM或IMA/ADPCM数据的WAV文件. ...
- html按钮按下效果_Animate/FLASH如何为按钮添加声音(无代码)
在游戏制作过程中,按钮在鼠标滑过和点击的时候都会有声音,可以在按钮元件的帧上添加,或者使用代码进行制作,这里先讲如果使用按钮的帧添加交互声音.主要知识点:声音的添加 AnimateCC如何使用声音文件 ...
- iOS 播放系统声音系统声音大全
在app开发中使用系统音效有震动,声音类. 设置方法如下 步骤1 添加所需库文件,即"AudioToolbox.framework" 步骤2 在使用类中添加头文件,即 #impor ...
- iOS 自定义返回按钮,保留系统滑动返回
1.简介 使用苹果手机,最喜欢的就是用它的滑动返回.作为一个开发者,我们在编写很多页面的时候,总是会因为这样那样的原因使得系统的滑动返回不可用.使用导航栏push出一个控制器,我们在控制器中自定义了一 ...
- iOS播放音乐与播放系统声音
相同点: 都可以播放声音 不同点: 播放系统声音: 时间较短,不能暂停或者停止 播放音乐: 可播放时间较长的音乐,歌曲等. 可以暂停,停止. 代码块:播放系统声音 (大体分为四步) #import ...
- 疯狂ios之cocos2d中的声音
13.13 cocos2d中的声音 任何一个游戏中都不能缺少音乐和音效,苹果公司在iOS系统中提供了两个框架用于播放音乐,分别是AVAudioPlayer和OpenAL.使用AVAudioPlayer ...
- Xamarin iOS教程之添加和定制视图
Xamarin iOS教程之添加和定制视图 Xamarin iOS用户界面--视图 在iPhone或者iPad中,用户看到的摸到的都是视图.视图是用户界面的重要组成元素.例如,想要让用户实现文本输入时 ...
- PythonGUI开发:59行代码开发小型商店添加系统
2019独角兽企业重金招聘Python工程师标准>>> 前言 今天为大家介绍的是python的GUI图形界面开发..这也是非常重要的一部分,如果你想要开发桌面应用程序的话,免不了需要 ...
最新文章
- DIV+CSS常见问题的14条原因分析
- (三)SSO之CAS框架单点退出,退出到CAS登录界面
- Linux数据报文接收发送总结2
- 成功解决 gpu_device.cc:1120] Creating TensorFlow device (/device:GPU:0) - (device: 0, name: GeForce 94
- 修复虚拟磁盘LVM表
- java fileinputstream.read(byte[])_Java分享笔记:FileInputStream流的 read()方法 和 read(byte[] b)方法...
- 概述--Nginx集成Vcenter 6.X HTML Console系列之 1--(共4)
- es6中的let声明变量与es5中的var声明变量的区别,局部变量与全局变量
- 挑战程序设计竞赛(第2版)
- EL表达式和JSTL的介绍以及基本使用
- 10分钟带你进入Swagger的世界,快来看一看吧
- 支付宝推出信用租房 醉翁之意不在酒?
- N多计算机精品免费视频下载,不要别后悔啊
- 互联网公司平均薪资Top8 , 阿里勇夺第一。
- 麻省理工学院|软件构造|课程翻译
- 服务器关闭微软小娜,言而无信: 微软悄悄将小娜的禁用网络搜索选项废弃
- 立创eda学习笔记九:图层
- 二项堆与斐波那契堆各个操作时间复杂度
- [转]李开复:成长中的十个启发
- 主流ERP系统排名,主流ERP系统对比
热门文章
- 字节跳动社招5面(已拿offer):算法+微服务+多线程+JVM+数据库
- 告别尴尬,自在出行,就选电动车排名前十名的绿源
- 如何学习一个新的计算机概念(协议等),如snmp? 上官网学习【官网集合】
- 学习java核心技术第3章的读书笔记
- CRMEB知识付费V2.1.4免授权版本更新发布
- yun yun de
- 送给程序员的话 - 大牛们的经典语录
- 我的世界(mc) 搭建 Forge 1.17.1 版 服务器教程,可装MOD,带面板
- 新手创业的几个误区你知道吗?
- 连接wifi推送广告