The direct value that you can get if you use AudioManager
AudioManager mAudioManager = Context.getSystemService(Context.AUDIO_SERVICE);
mAudioManager.getStreamVolume(STREAM_MUSIC);
The only function that gives you the ability to register a broadcast receiver is
mAudioManager.registerMediaButtonEventReceiver(audioBroadcastReceiver);
where audioBroadcastReceiver extends BroadcastReceiver and must be declared in the application manifest.
Not sure if this is exactly what you were looking for.
source
share