开发者

How do you control the playback levels (decibles?) using the iPhone AVAudioPlayer? Or do I need to use a different API?

开发者 https://www.devze.com 2022-12-23 07:43 出处:网络
My audio clips sound perfect when开发者_如何学运维 I upload them to the iPhone via iTunes.And I am pretty sure it is because the iPod has a maximum playback level, so the audio doesn\'t sound overdriv

My audio clips sound perfect when开发者_如何学运维 I upload them to the iPhone via iTunes. And I am pretty sure it is because the iPod has a maximum playback level, so the audio doesn't sound overdriven. In my app, I include the same audio files, and when I play them [myAudio play]; the levels are so high that the audio becomes indiscernible.

I found in the library that it says that you can "Control relative playback level for each sound you are playing" but I've been searching this issue out for hours and I haven't gotten anywhere.


If you are using AVAudioPlayer, you can just set the player's internal volume to be a float. Think of it as pre-gain… this volume does not control the speaker output volume, but controls the source volume.

[audioPlayer setVolume:0.5];

Source: I have used in in my apps, and the docs

0

精彩评论

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