Search code examples
javaandroidyoutubespotifyandroid-music-player

Android - adjust individual application volume


Is there any library that allows me to create an application that can adjust volume of individual application?

More specifically, I am creating an "sound mixer" application where the user can play multiple sounds with their desired volume. So in my application say the user open Spotify / YouTube music via inexplicit intent. Is there any way, I can lower the volume of the playback of that given application only?


Solution

  • You can change system volume by interacting with AudioManager. Just need to remember prefered volume level for each app and set to that level based on what app user opens.