以恒定音量播放 iPhone 音频
我正在使用 AudioQueue Services 在我的应用程序中播放音频(AQPlayer 借自 Speak Here),我想知道是否可以以恒定的音量播放音频,无论 iPhone 的硬件音量如何。
Apple 的phone.app 键盘就是一个例子,无论您的硬件音量如何,铃声都会以相同的音量播放。
I am using AudioQueue Services to play audio in my app (AQPlayer borrowed from Speak Here) and I would like to know if it is possible to play the audio at a constant volume regardless of the iphone hardware volume.
Apple's phone.app keypad is an example of this, the tones play at the same volume regardless of your hardware volume.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可能不应该这样做,人们设置音量是有原因的。
如果你真的认为你必须这样做;一种方法可能是确定硬件音量并按所需的量前置声音以获得相同的音量。 (基本上,如果硬件音量为“5”,并且您希望声音以“8”播放,则必须将声音前置放大“3”。)
You probably shouldn't do that, people set their volume for a reason.
If you really think you must; an approach could possibly be to determine the hardware volume and preamp your sound by the required amount to receive the same volume. (Basically, if the hardware volume is at "5", and you want your sound to play at "8", you have to preamp your sound by "3".)