简体   繁体   English

iOS键盘声音错误(大声然后正常)

[英]iOS keyboard sound bug (once loud then normal)

There is a seldom loud "tap" sound, when I type inside UITextField in my app. 当我在应用程序中的UITextField中键入内容时,很少有“敲击”声。 Problem appears when I type some number of characters (it's not necessary to do it fast) - all "taps" play at the same sound level, one - louder. 当我输入一定数量的字符时,问题就出现了(不必快速执行)-所有“敲击”都以相同的声音级别播放,一个-更大声。 And it looks like there is some micro-delay / hang up before loud sound. 看起来有些微延迟/在响亮的声音之前挂断了。

I tried to put new UITextField on the screen (to test without display settings and additional behavior - with only frame and autoresizingMask changed). 我试图在屏幕上放置新的UITextField (以测试没有显示设置和其他行为-仅更改frameautoresizingMask )。 Still happens. 仍然发生。

Any ideas? 有任何想法吗?

UPDATE 更新

Got bug on device. 在设备上发现错误。 Tested on iPhone 5, iPhone 6, iPad 3. Sound is not so loud on iPad, but yet slightly louder. 在iPhone 5,iPhone 6,iPad 3上进行了测试。iPad上的声音不是很大,但是略大。

It was a very strange case... 这是一个非常奇怪的情况。

In my app I'm trying to detect muted sound (by switch or volume = 0). 在我的应用中,我尝试检测静音(通过开关或音量= 0)。 The only way to do it is to play sound with silence (sound file with no real sound) and measure it (when sound is muted, play time will be small [empirics here] - only to launch operation). 做到这一点的唯一方法是播放无声的声音(没有真实声音的声音文件)并对其进行测量(当声音被静音时,播放时间会很短[此处为经验]-仅用于启动操作)。

So to make this check automatic, I've created background task with infinite loop for observation. 因此,要使此检查自动进行,我创建了带有无限循环的后台任务以进行观察。 And this is the way the bug appeared: lag is not on each tap, but if you quickly tap a lot of times, you will 100% get it. 这就是该错误的出现方式:每次敲击都不会出现滞后,但是如果您多次快速敲击,您将100%得到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM