I have a button in my iPhone app that I'd like to have play the default "keyboard tap" sound when it's tapped. I've been able to play my own custom sounds easily enough, but is there any way to play a default system sound like this in my app?
+1
A:
Nothing public. There's probably an answer if you're willing to dive into private APIs, but this is strongly discouraged (as you will likely break future compatibility, and may get rejected from the app store).
Kevin Ballard
2009-05-19 19:04:53
+1
A:
There's an example on the iPhone Dev Center web site for playing short-duration sounds (5 seconds or less), You can use that code to play any sound you want. Find a click sound doing a google search and use that. That's all you need.
AudioServicesCreateSystemSoundID (fileURL, soundID);
Jordan
2009-05-19 19:29:17
But how can I play the exact keyboard tap sound? I can't seem to find that anywhere on the net, and what if Apple changes it in the future?
drewh
2009-05-19 19:43:43
What could they possibly change it to that would be so different? An owl hooting?
willc2
2009-05-20 04:03:32
I'm sorry, I just cracked myself up making hooting noises while fake typing. Ignore me!
willc2
2009-05-20 04:04:32
+1
A:
The click sound you want is, I believe, in the sample app called SysSound.
http://developer.apple.com/iphone/library/samplecode/SysSound/
Michael
2009-07-07 19:56:52
+2
A:
Check out this thread:
http://stackoverflow.com/questions/818515/iphone-how-to-make-key-click-sound-for-custom-keypad
aSquared
2009-08-01 19:04:53