Call system vibration and sound

Source: Internet
Author: User

 

It is always complicated to set the vibration or sound of the software. I did some research today, but it is OK. It is not very complicated.

 

Among them, the software's vibration and sound, whether there is vibration, whether there is sound, is exactly the same as the Apple mobile phone settings. You don't need to worry about this.

 

System sound:

 

1. The audio format is MP3 or m4r and needs to be converted to the caf format (you can convert it to AIF or AIFF first, and then modify the suffix)
2. The path is in/system/library/Audio/uisounds. To change the path, replace it with the following list:
3. Detailed List:
Information
Receivedmessage. caf -- receives the message and plays it only when the text message interface is opened.
Sms-received1.caf ------- sanquanyin
Sms-received2.caf ------- Guan zhongqin
Sms-received3.caf ------- glass
Sms-received4.caf ------- circle
Sms-received5.caf ------- ringtones
Sms-received6.caf ------- e-music
Sentmessage. CAF -------- send message

Email
Mail-sent.caf-send mail
New-mail.caf ----- receive new mail

Phone number
Dtmf-0.caf ---------- dial panel 0 buttons
Dtmf-1.caf ---------- dial Panel 1 button
Dtmf-2.caf ---------- dial panel 2 buttons
Dtmf-3.caf ---------- dial panel 3 buttons
Dtmf-4.caf ---------- dial panel 4 buttons
Dtmf-5.caf ---------- dial Panel 5 buttons
Dtmf-6.caf ---------- dial Panel 6 buttons
Dtmf-7.caf ---------- dial Panel 7 buttons
Dtmf-8.caf ---------- dial Panel 8 buttons
Dtmf-9.caf ---------- dial panel 9 buttons
Dtmf-pound.caf --- dial panel # buttons
Dtmf-star.caf ------ dial panel * buttons
Voicemail. CAF ----- new voice mail

Enter device sound prompt
Tock. CAF ------------------------- click the keyboard
Begin_record.caf ----------- start recording
Begin_video_record.caf -- start recording
Photoshutter. CAF ------------ shutter sound
End_record.caf ------------ End recording
End_video_record.caf ----- end video

Others
Beep-beep.caf-charging, deregistering, and connecting to computers
Lock. CAF ------------ lock the mobile phone
Shake. CAF --------- "this is not clear yet"
Unlock. CAF -------- slide to unlock
Low_power.caf -- Low Power prompt

Voice Control
Jbl_ambiguous.caf -- find multiple matches
Jbl_begin.caf ------ waiting for user input
Jbl_cancel.caf ----- cancel
Jbl_confirm.caf ---- run
Jbl_no_match.caf --- no matching found

Calendar
Alarm. Caf-calendar reminder

IPod Touch 1g
Sq_alarm.caf
Sq_beep-beep.caf
Sq_lock.caf
Sq_tock.caf

Unused system sound
Ussd. CAF
Short_double_high.caf
Short_double_low.caf
Short_low_high.caf
Middle_9_short_double_low.caf
Long_low_short_high.caf
Ringerchanged. CAF
Simtoolkitcalldropped. CAF
Simtoolkitgeneralbeep. CAF
Simtoolkitnegativeack. CAF
Simtoolkitpositiveack. CAF
Simtoolkitsms. CAF
Ct-busy.caf
Ct-call-waiting.caf
Ct-congestion.caf
Ct-error.caf
Ct-keytone2.caf
Ct-path-ack.caf
Tink. CAF

 

Thanks http://bbs.feng.com/read-htm-tid-6262661.html

 

Let's get the code:

 

# Import <audiotoolbox/audiotoolbox. h>-(void) viewdidload {[Super viewdidload]; // do any additional setup after loading the view. self. title = @ "rootviewcontroller"; // This vibration does not vibrate. Is there any sound that is the same as that set on the mobile phone. // Call the system vibration [self getchatmessagegotoshake]; // call the system sound [self getchatmessagegotosound];}
# Pragma-mark-call system vibration-(void) getchatmessagegotoshake {// call system vibration audioservicesplaysystemsound (ksystemsoundid_vibrate);} # pragma-mark-call system sound-(void) getchatmessagegotosound {// call the system sound nsstring * Path = [nsstring stringwithformat: @ "/system/library/Audio/uisounds/% @. % @ ", @" sms-received3 ", @" caf "]; If (PATH) {systemsoundid SD; osstatus error = audioservicescreatesystemsoundid (_ bridge cfurlref) [nsurl fileu Rlwithpath: path], & SD); // If (error! = Kaudioservicesnoerror) {nslog (@ "---- call system sound error ----"); SD = 0 ;}audioservicesplaysystemsound (SD );}}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.