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
Eric Aya
  • 69,473
  • 35
  • 181
  • 253
cyril
  • 3,020
  • 6
  • 36
  • 61
  • Please review the answer and mark it as answered if you find it useful – L A Sep 02 '16 at 19:21
  • @LA sorry just got some time to myself. How exactly did you find them, if I may ask? – cyril Sep 02 '16 at 19:47
  • 1
    I created a demo app for that :) think UILabel next to a Play UIButton, and two other buttons to up/down the ID number :) took some 10-15 min, but it was worth it. Now my (and hopefully yours and others) custom keyboard is iOS10 sounds ready! – L A Sep 02 '16 at 20:09

2 Answers2

11

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

L A
  • 966
  • 11
  • 25
6

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()
}
pacification
  • 5,838
  • 4
  • 29
  • 51
HixField
  • 3,538
  • 1
  • 28
  • 54