Question

Here is the UI of each controller which i want to set

Q How to get the level of volume setted for each media?

enter image description here

Regrads mann

Était-ce utile?

La solution

You can get various stream volume levels using getStreamVolume from the AudioManager.

For example:

int musicVolume = audioManager.getStreamVolume(AudioManager.STREAM_MUSIC);

Available streams copied from the Android docs: AudioManager

STREAM_ALARM             The audio stream for alarms
STREAM_DTMF              The audio stream for DTMF Tones
STREAM_MUSIC             The audio stream for music playback
STREAM_NOTIFICATION      The audio stream for notifications
STREAM_RING              The audio stream for the phone ring
STREAM_SYSTEM            The audio stream for system sounds
STREAM_VOICE_CALL        The audio stream for phone calls
USE_DEFAULT_STREAM_TYPE  Suggests using the default stream type.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top