Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

howto receive media volume change notifications?

Tags:

android

Is it possible to register a BroadcastReceiver or something to get notifications of media player volume changes?

Thanks

like image 206
acurtis Avatar asked Jan 21 '11 20:01

acurtis


People also ask

How do I turn on volume notifications?

Go to Settings. Depending on your phone's Android version, do one of the following: Tap Sound > Advanced > Default notification sound. Tap Sound & notification > Notification sound.

How do I control volume on notifications?

Change your notification soundOpen your phone's Settings app. Default notification sound. Choose a sound. Tap Save.

Where do I find notification volume?

Open your device's Settings app . Sound Notifications. Settings . Tap Notification preferences.

What is media volume on my Phone?

If your phone is paired to more than one Bluetooth device, you can change where you hear music, videos, and games. Under "Media volume," tap Play media to. When you press a volume button, the volume that changes depends on what you're doing. For example, if you're watching a movie, the movie volume changes.


1 Answers

Immediate value you can get if you use AudioManager

AudioManager mAudioManager = Context.getSystemService(Context.AUDIO_SERVICE);
mAudioManager.getStreamVolume(STREAM_MUSIC);

The only function that gives you opportunity to register 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.

like image 134
Zelimir Avatar answered Oct 12 '22 19:10

Zelimir