简体   繁体   中英

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. The App plays a sound through the speaker. Now the volume is still quite low even after I turn my iPhone to maximum volume. 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

As the link says: "The values can vary between -1.0 and +1.0". I have already set all the sample points to 1 or -1 in the App.

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."

Change the constant in the sample code from:

const double amplitude = 0.25;

To:

const double amplitude = 1.0;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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