开发者

iPhone SDK: How to normalize audio playback using AVAudioPlayer?

开发者 https://www.devze.com 2023-02-02 01:17 出处:网络
I\'m doing some test开发者_StackOverflow中文版ing with AVAudioPlayer and notice that the audio is very low. Some apps, like Audio Memos Free, has an option to \"auto normalize\" playback volume and th

I'm doing some test开发者_StackOverflow中文版ing with AVAudioPlayer and notice that the audio is very low. Some apps, like Audio Memos Free, has an option to "auto normalize" playback volume and this results in a significantly louder playback than if I have the AVAudioPlayer volume set to 100%. How are apps like that normalizing playback volume? I don't see any control over the in the AVFoundation classes.


In AVAudioSession class there are various categories to handle playback http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html. In this if you use AVAudioSessionCategoryPlayback you will get higher playback sound compared to other categories like AVAudioSessionCategoryPlayAndRecord. Also there is a setVolume: property for AVAudioPlayer. If you need more control over your audio you can use Core Audio framework. Please refer http://developer.apple.com/library/mac/#documentation/MusicAudio/Reference/CACoreAudioReference/CoreAudioTypes/CompositePage.html and the sample Speak Here application http://developer.apple.com/library/ios/#samplecode/SpeakHere/Introduction/Intro.html for more details. Hope this helps you.

0

精彩评论

暂无评论...
验证码 换一张
取 消