简体   繁体   English

如何使用AudioUnits放大IOS APP中的音量?

[英]How to amplify the sound volume in an IOS APP using AudioUnits?

I am developing an IOS App based on "AudioUnits", which is the lowest level audio API in IOS. 我正在开发基于“ AudioUnits”的IOS App,这是IOS中最低级别的音频API。 The App plays a sound through the speaker. 该应用程序通过扬声器播放声音。 Now the volume is still quite low even after I turn my iPhone to maximum volume. 现在即使将iPhone调到最大音量,音量仍然很低。 I want to make the sound volume more loudly, but I don't know how to do. 我想使音量更大,但我不知道该怎么办。

The App is just based on the following one: http://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html 该应用程序仅基于以下之一: http : //www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html

As the link says: "The values can vary between -1.0 and +1.0". 如链接所示:“值可以在-1.0到+1.0之间变化”。 I have already set all the sample points to 1 or -1 in the App. 我已经在应用程序中将所有采样点设置为1或-1。

Hope anyone can give me some ideas. 希望任何人都能给我一些想法。

The entire comment in the link is "The values can vary between -1.0 and +1.0 but we're going to limit our samples to a smaller range than that to keep the volume to a reasonable level." 链接中的整个注释是:“值可以在-1.0到+1.0之间变化, 但我们将限制采样范围 ,以使音量保持在合理水平。”

Change the constant in the sample code from: 从以下示例中更改示例代码中的常量:

const double amplitude = 0.25;

To: 至:

const double amplitude = 1.0;

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

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