iPhone:如何使自定义键盘按键音? [英] iPhone: how to make key click sound for custom keypad?

查看:206
本文介绍了iPhone:如何使自定义键盘按键音?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法以编程方式调用键盘咔嚓声?我的应用程序有一个自定义键盘(建出来UIButtons的),我想,当用户点击的按键提供一些音频反馈。我试过在GarageBand创造我自己的声音,但并不快乐与任何我的创作。如果没有调用键点击一个标准的方式,任何人都可以点我的声音库,可能有这样的宝石?

Is there a way to programmatically invoke the keypad "click" sound? My app has a custom keypad (built out of UIButtons) and I'd like to provide some audio feedback when the user taps on the keys. I tried creating my own sounds in Garageband, but wasn't happy with any of my creations. If there isn't a standard way to invoke the key click, can anyone point me to a library of sounds that might have such a gem?

推荐答案

我发现最简单的方法是从iPhone模拟器提取Tock.aiff(键盘的声音),并与您的应用程序打包,然后用它玩 AudioServicesPlaySystemSound()在适当的时候。在我的机器,只需键入Tock.aiff到Spotlight轮番上涨的文件,但如果你必须去寻找它,它在UIKit.framework的模拟器版本。

The simplest way I've found is to extract Tock.aiff (the keyboard sound) from the iPhone Simulator and package it with your app, then play it using AudioServicesPlaySystemSound() at the appropriate time. On my machine, simply typing Tock.aiff into Spotlight turns up the file, but if you have to go looking for it, it's in the simulator version of UIKit.framework.

这篇关于iPhone:如何使自定义键盘按键音?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆