I am programming an app to allow for locally stored mp3 file playback as well as streaming from a server.
I use
AVAudioPlayer *player;
AVPlayer *player2;
depending on the type of playback. How do I query what the device volume level is initially so that I can set my volume.slider to its initial value?
First, import:
#import <AVFoundation/AVAudioSession.h>
Then get The system wide output volume set by the user using:
float volume = [[AVAudioSession sharedInstance] outputVolume];
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