Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switches between Android volumes #5

Closed
lgraubner opened this issue Nov 27, 2017 · 5 comments
Closed

Switches between Android volumes #5

lgraubner opened this issue Nov 27, 2017 · 5 comments

Comments

@lgraubner
Copy link

Android has four different volumes (Media, Sound, Notifications, System). It seems like I get always the "active" volume, but this switches quite often. How to get/set a specific volume?

@c19354837
Copy link
Owner

getVolume() return the "Music" volume actually, see code

I consider to extended it. And it will look like getVolume(type:String), so you can get the specific volume. The type should be one of these (copy from Android open source codes):

/** The audio stream for phone calls */
public static final int STREAM_VOICE_CALL = AudioSystem.STREAM_VOICE_CALL;
/** The audio stream for system sounds */
public static final int STREAM_SYSTEM = AudioSystem.STREAM_SYSTEM;
/** The audio stream for the phone ring */
public static final int STREAM_RING = AudioSystem.STREAM_RING;
/** The audio stream for music playback */
public static final int STREAM_MUSIC = AudioSystem.STREAM_MUSIC;
/** The audio stream for alarms */
public static final int STREAM_ALARM = AudioSystem.STREAM_ALARM;
/** The audio stream for notifications */
public static final int STREAM_NOTIFICATION = AudioSystem.STREAM_NOTIFICATION;

@lgraubner
Copy link
Author

That would be awesome. Do you already know when this will be available (approximately)?

@c19354837
Copy link
Owner

Two hours will be ok. I'm doing this

@c19354837
Copy link
Owner

V 1.0.8 has published!

I have updated the example and screenshot, and you will find the different

API is refreshed too.

I need to sleep now😪

@lgraubner
Copy link
Author

Awesome, thank you! Works as far as I tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants