I found an example here, but it does not work on ios6.1.3 (iphone 4s). always return 0.187500
Code:
Float32 volume;
UInt32 dataSize = sizeof(Float32);
AudioSessionInitialize (NULL, NULL, NULL, NULL);
AudioSessionGetProperty (
kAudioSessionProperty_CurrentHardwareOutputVolume,
&dataSize,
&volume
);
NSLog(@"%f", volume);
[AVAudioSession sharedInstance].outputVolume - also return 0.187500