I'm interested in retrieving the current volume of a MediaPlayer, but don't see any method like 'getVolume()' on it. There is a setVolume(), so I'm a little confused as to why they don't also provide a way to read this property.
I saw some other answers that suggested to use AudioManager to read the volume:
int volumeLevel = am.getStreamVolume(AudioManager.STREAM_MUSIC);
int maxVolume = am.getStreamMaxVolume(AudioManager.STREAM_MUSIC);
float volume = (float)volumeLevel/maxVolume;
However, this seems to return the device volume for all music, and not the volume that I'm setting with 'setVolume()'... is there a way to do get the volume directly from a MediaPlayer? I was thinking perhaps I need to do something with getAudioSessionId(). Thanks.