System will bring some sound, sometimes some operations with the necessary to play a sound to remind you, with Bash direct say something is OK, write code when? It was simple, a sentence: [[Nssound soundnamed:@ "Hero"] play];
It's OK.
Where hero is the file name, specifically what filename to go here to find
/system/library/sounds
List of general file names:
Basso
Blow
Bottle
Frog
Funk
Glass
Hero
Morse
Ping
Pop
Purr
Sosumi
Submarine
Tink
Hey, so easy
Translated from: Playing system sounds
reprint Please specify: transfer from Rainbird's personal blog
Predefined SoundsThere is some predefined system sounds, for the system sound ID in the range of (decimal), as shown below (from 2.0 to 5.0 Beta). The system sounds is 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 is no category for this sound before 4.0. |
1071 |
Ct-congestion.caf |
Ct-congestion.caf |
Audiotonecongestion |
There is no category for this sound before 4.0. |
1072 |
Ct-path-ack.caf |
Ct-path-ack.caf |
Audiotonepathacknowledge |
There is no category for this sound before 4.0. |
1073 |
Ct-error.caf |
Ct-error.caf |
Audiotoneerror |
There is no category for this sound before 4.0. |
1074 |
Ct-call-waiting.caf |
Ct-call-waiting.caf |
Audiotonecallwaiting |
There is no category for this sound before 4.0. |
1075 |
Ct-keytone2.caf |
Ct-keytone2.caf |
AudioToneKey2 |
There is 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 |
|
160° |
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 |
|
170° |
Alarm.caf |
Sq_alarm.caf |
Systemsoundpreview |
|
1305 |
Lock.caf |
Sq_lock.caf |
Systemsoundpreview |
|
120W |
Tock.caf |
Sq_tock.caf |
Keypressclickpreview |
The category was Systemsoundpreview before 3.2. |
120V |
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 is no category for this sound before 2.2. The SDK is the constant ksystemsoundid_vibrate. |
Share to:
Call method One:
Systemsoundid Myalertsound;
nsurl *url = [nsurl urlwithstring: @ "/SYSTEM/LIBRARY/AUDIO/UISOUNDS/BEGIN_VIDEO_RECORD.CAF" ];
Audioservicescreatesystemsoundid(__bridge cfurlref) (URL), &myalertsound);
Audioservicesplaysystemsound(myalertsound);
Call method Two:
NSString *path = [[NSBundle bundlewithidentifier:@ "Com.apple.UIKit"] pathforresource:@ " Tock " ofType:@" AIFF "];
if (path) {
Systemsoundid Thesoundid;
Osstatus error = Audioservicescreatesystemsoundid((__bridge cfurlref) [Nsurl Fileurlwithpath :p Ath], &thesoundid);
if (Error = = kaudioservicesnoerror) {
Audioservicesplaysystemsound (Thesoundid);
}
Else
{
NSLog(@ "Failed to create Sound");
}
}
Osx/ios Playback system Sound