开发者

How can i set volume with amplification in app with AVPlayer class?

开发者 https://www.devze.com 2023-04-05 03:39 出处:网络
I am using AVPlayer for playing song from iPod Library. There are very limited methods in AVPlayer compare to AVAudioPlayer.

I am using AVPlayer for playing song from iPod Library. There are very limited methods in AVPlayer compare to AVAudioPlayer.

When I play song using AVPlayer in iPhone, the actual sound is very low compare to the song played in iPod Library.

My code goes as below:

AVPlayer *avPlayer = [[AVPlayer alloc] initWithURL:songURL];
[avPlayer 开发者_如何学Cplay];

How can I amplify sound or increase volume while playing with AVPlayer??

Edit: I had also gone through this question and tried the apple's link but there is no significant difference in sound. I tried passing volume in float as 0.8, 1.0, 2.0, 10.0, 100.0. But when i pass higher values then disturbance increases... and Volume does not increase.

What are the other ways to increase sound with AVPlayer??


Check out this link.

You cannot set volume greater than 1.0 for AVPlayer. If you increase volume to a value more than 1.0 then the distortion of voice and disturbance will increase.

But you need to check whats the output source of the player. Default is microphone, so try setting it to loudspeaker to get louder output.

Please refer below link for that.

How to record and play sound in iPhone app?

How to increase volume of sound recorded using AVAudioRecorder

Hope this help you.

0

精彩评论

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