Is there a way to set the AVAudioSession outputVolume?
self.audioSession = AVAudioSession.sharedInstance()
self.audioSession.setActive(true, error: n
The outputVolume
property is read-only. This is due to Apple's conviction that a good user experience will be broken if apps unexpectedly modify sound volume beyond user control.
From the AVAudioSession docs:
The system wide output volume can be set directly only by the user; to provide volume control in your app, use the MPVolumeView class
So this is your only (easy) option...
MPVolumeView *myVolumeView =
[[MPVolumeView alloc] initWithFrame:frame];
[self.view addSubview: myVolumeView];