How to change an iOS device volume programmatically?

DrCachetes picture DrCachetes · Mar 14, 2015 · Viewed 19k times · Source

Is there a way to change the device volume programmatically? maybe using audio session?

Answer

Steffen D. Sommer picture Steffen D. Sommer · Mar 14, 2015

I'm pretty sure that it is not possible to control the actual device volume (as this would also be a bit obtrusive) Controlling some media you're playing is another thing. You could however look into MPVolumeView: https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPVolumeView_Class/index.html for displaying a view for setting the volume.

The question has also been discussed here: How to change device Volume on iOS - not music volume