Update for Swift
let vol = AVAudioSession.sharedInstance().outputVolume
The audio session can provide output volume (iOS >= 6.0).
float vol = [[AVAudioSession sharedInstance] outputVolume];
NSLog(@"output volume: %1.2f dB", 20.f*log10f(vol+FLT_MIN));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…