I'm having a problem with AVAudioPlayer's volume.
I can set theAudio.volume property to 1.0, but I'd rather just play the audio at the volume the user has his iphone ringer set to.
Getting rid of the volume property defaults it at 1.0.
This seems trivial, but I couldn't find a reference to it anywhere.
Thanks a bunch!
The volume you set to a AVAudioPlayer instance is just a relative volume, for example if you wanna play two sounds, one at half volume of the other, you set the first one to 0.5 and the second to 1.0.
The real device volume is only controlled by the user and can't be change programaticly. (Audio & Video Coding How-To's - How do I access the hardware volume controller?)
You can add a MPVolumeView for the user the control the global volume.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With