注册 登录
筛选: 全部
主题 : 播放系统声音&震动&系统声音对照表
级别: 骑士

状态: 连续签到 - [7天]
UID: 97807
精华: 0
发帖: 237
可可豆: 1806 CB
威望: 1797 点
在线时间: 226(时)
注册时间: 2011-10-13
最后登录: 2019-03-21
0 楼:  发表于: 2013-02-21 18:20    发自: Web Page

播放系统声音&震动&系统声音对照表   

  • 分享类型
如题
#import <AudioToolbox/AudioToolbox.h>
#import <UIKit/UIKit.h>  
- (void)vibrate   {    
  AudioServicesPlaySystemSound(SystemSoundID);
   }
当参数为:kSystemSoundID_Vibrate 时就是震动
;
ps(只有iphone才能震动而且还得在设置里开启震动才行,其他的如touch就没有震动功能,别忘了导入AudioToolbox框架)

当参数为 1000-2000 之间数字时就是播放系统声音

系统声音对照表:

There 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 kSystemSoundID_Vibrate.


参考:http://iphonedevwiki.net/index.php/AudioServices

  
playSystemsound demo    playSystemsound.zip (71 K) 下载次数:1579

关键词: 系统声音 震动
小资喝花酒,老兵坐床头.知青咏古自助游,皇上宫中愁.
剩女宅家里,萝莉嫁王侯.名媛丈夫死得早,MM在青楼.
级别: 新手上路
UID: 65778
精华: 0
发帖: 7
可可豆: 9 CB
威望: 8 点
在线时间: 103(时)
注册时间: 2011-04-23
最后登录: 2018-07-30
1 楼:  发表于: 2013-02-21 21:04    发自: Web Page
非常有用,谢谢!!!
级别: 风云使者

状态: 连续签到 - [309天]
UID: 83747
精华: 0
发帖: 3865
可可豆: 19534 CB
威望: 19405 点
在线时间: 2397(时)
注册时间: 2011-07-27
最后登录: 2018-11-05
2 楼:  发表于: 2013-02-22 11:32    发自: Web Page
这个牛掰了。
级别: 圣骑士

状态: 连续签到 - [1天]
UID: 21430
精华: 0
发帖: 432
可可豆: 2237 CB
威望: 2110 点
在线时间: 626(时)
注册时间: 2010-06-07
最后登录: 2016-04-08
3 楼:  发表于: 2013-02-22 13:54    发自: Web Page
兄弟,这个贴非常有价值!
“编程的时候,总是想着那个维护你代码的人会是一个知道你住在哪儿的有暴力倾向的精神病患者。”—— Martin Golding
级别: 侠客
UID: 66095
精华: 0
发帖: 120
可可豆: 669 CB
威望: 669 点
在线时间: 86(时)
注册时间: 2011-04-25
最后登录: 2014-10-10
4 楼:  发表于: 2013-02-22 14:17    发自: Web Page
mark mark mark
级别: 侠客
状态: 连续签到 - [2天]
UID: 63475
精华: 0
发帖: 95
可可豆: 218 CB
威望: 212 点
在线时间: 209(时)
注册时间: 2011-04-12
最后登录: 2018-09-23
5 楼:  发表于: 2013-02-22 17:27    发自: Web Page
没嘴会用到 mark
级别: 圣骑士

UID: 3201
精华: 0
发帖: 280
可可豆: 3778 CB
威望: 3778 点
在线时间: 1066(时)
注册时间: 2009-03-17
最后登录: 2019-04-22
6 楼:  发表于: 2013-02-23 07:32    发自: Web Page
哪个是成就解锁的声音啊?
级别: 风云使者

状态: 连续签到 - [25天]
UID: 29025
精华: 0
发帖: 2724
可可豆: 18569 CB
威望: 18611 点
在线时间: 11962(时)
注册时间: 2010-08-29
最后登录: 2019-04-22
7 楼:  发表于: 2013-02-23 16:14    发自: Web Page
非常好,学习了
天道酬勤!
级别: 新手上路
UID: 202360
精华: 0
发帖: 17
可可豆: 71 CB
威望: 71 点
在线时间: 6(时)
注册时间: 2013-01-11
最后登录: 2013-10-28
8 楼:  发表于: 2013-02-25 10:32    发自: Web Page
mark mark mark
级别: 圣骑士
UID: 58929
精华: 0
发帖: 441
可可豆: 2678 CB
威望: 2628 点
在线时间: 563(时)
注册时间: 2011-03-22
最后登录: 2017-05-10
9 楼:  发表于: 2013-04-16 18:55    发自: Web Page
会影响上架吗?
Don't pray for easy lives, Pray to be stronger men

CocoaChina社区转载内容已尽可能注明出处,如未能核实来源或转发内容图片有权利瑕疵的,请及时联系社区进行修改或删除【联系方式QQ : 3442093904 邮箱:support@cocoachina.com】文章内容为作者独立观点,不代表CocoaChina社区立场。版权归原作者所有,如申请授权请联系作者,因文章侵权CocoaChina社区不承担任何法律及连带责任。

描述
快速回复

关注本帖(如果有新回复会站内信通知您)

发帖、回帖都会得到可观的积分奖励。查看论坛积分规则

按"Ctrl+Enter"直接提交
    顶部