Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the system sound ids for the new keyboard clicks in iOS 10?

General
I'm developing a third party keyboard and am currently trying to mimic the new keyboard clicks that Apple introduced in iOS 10b4.

Current Situation
The regular click sound can be played using AudioServicesPlaySystemSound(1104) but I can't seem to find the System Sound IDs for the two new other sounds. I've found the location of their .caf equivalents but those are way too loud to use, even after adjusting their volume using AVAudioPlayer.

Question
Is it possible to obtain the system sound ids of the new click sounds?

Extra
If anyone wants the .caf file paths for personal use, here they are:

/System/Library/Audio/UISounds/key_press_click.caf
/System/Library/Audio/UISounds/key_press_delete.caf
/System/Library/Audio/UISounds/key_press_modifier.caf
like image 296
cyril Avatar asked Aug 20 '16 14:08

cyril


People also ask

What are iPhone system Sounds?

System Sound Services provides a C interface for playing short sounds and for invoking vibration on iOS devices that support vibration. You can use System Sound Services to play short (30 seconds or shorter) sounds.

What are iPhone keyboard clicks?

Two such sounds are the Keyboard Clicks and Lock Sounds on the iPhone. When the function is turned on, you'll hear a sound similar to a door closing when pressing your side button (Sleep/Wake button) that lets you know you've locked your phone without needing to look.

Can you change the volume of keyboard clicks on iPhone?

You can do this by simply adjusting the volume buttons, but if you have 'Change with Buttons' disabled, your Ringer and Alerts volume level will be set by a slider. You can find this slider, along with the 'Change with Buttons' option, within Settings > Sounds & Haptics > Ringer and Alerts.


2 Answers

iOS 10.0 - iOS 11.0 b5

Press Click - ID: 1123

Press Delete - ID: 1155

Press Modifier - ID: 1156

Comment (1): Same IDs work for iOS 11 beta 5

like image 178
L A Avatar answered Dec 14 '22 23:12

L A


Implemented in swift using an enum (extend with your own other system sound id's):

import AudioToolbox


enum SystemSound: UInt32 {

    case pressClick    = 1123
    case pressDelete   = 1155
    case pressModifier = 1156

    func play() {
        AudioServicesPlaySystemSound(self.rawValue)
    }

}

and use like this:

@IBAction func pressedDigit(sender : UIButton) {
    SystemSound.pressClick.play()
}
like image 22
HixField Avatar answered Dec 15 '22 01:12

HixField