如何获得iPhone OS 3.1低沉的声音键盘? [英] How to get iPhone OS 3.1 muffled keyboard sound?

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

问题描述

我已经加入了iPhone的笃声音​​我自己的自定义键盘是这样的:

I have added the iPhone's Tock sound to my own custom keyboard like this:

NSString *path = [[NSBundle bundleWithIdentifier:@"com.apple.UIKit"] pathForResource:@"Tock" ofType:@"aiff"];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID);
AudioServicesPlaySystemSound(soundID);
// we don't dispose of the sound to keep the sound in the cache for the next time
//AudioServicesDisposeSystemSoundID(soundID);

在iPhone OS的3.1,然而,在键盘笃音被裹住,例如比其他的声音更安静,比它在3.0。我的方法的声音依然很响亮,并在最大音量。我怎么能得到相同的卷作为iPhone的默认键盘?

In iPhone OS 3.1, however, the keyboard Tock sound has been muffled, e.g. is much more silent than other sounds and than it was in 3.0. My method's sound is still very loud and at the maximum volume. How could I get the same volume as the iPhone's default keyboard?

顺便说一句,在笃声音Twitterrific适当闷响。

By the way, the Tock sound in Twitterrific is muffled appropriately.

干杯

MrMage

推荐答案

使用0x450作为SystemSoundID对我的作品在正确的音量 - 注意,不尊重键盘点击开启/关闭preference

Using 0x450 as the SystemSoundID works for me at the correct volume - note that it doesn't respect the keyboard clicks on/off preference.

我不知道怎么便携本是 - 它为我在模拟器上和与iPod Touch 3代。我怀疑它适用于所有的设备,但在软件更新,恕不另行通知可能改变。

I'm not sure how portable this is - it works for me on the simulator and on an iPod Touch 3rd gen. I suspect it works on all devices but could change without notice in a software update.

我通过AudioServicesPlaySystemSound设置断点,pressing普通键盘按键得到这个数字 - 第一个汇编指令复制SystemSoundID到寄存器,所以你可以看到它在寄存器中的调试器中查看

I got this number by setting a breakpoint on AudioServicesPlaySystemSound and pressing a normal keyboard key - the first assembly instruction copies the SystemSoundID into a register, so you can see it in the Registers view in the debugger.

这篇关于如何获得iPhone OS 3.1低沉的声音键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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