2

I really hate it that every new app (mostly games) that I install, thinks it has a right to make noise. Just about every game I ever installed comes with audio enabled by default.

This is annoying for two reasons:

  • It makes noise if I forgot to disable global sound, which sucks if I am in public transport or any other environment where smartphone noises are unacceptable
  • If I am listening to music on my phone it gets interrupted until I disable the app's sound and restart the music

Disabling sound globally is not a good solution either, because then I have to enable it again every time I open an app that I want to have sound, e.g. music or Youtube.

Is there a way (e.g. an app, preferably without root) to have a whitelist of apps that are allowed to have sound while every other app's sound is muted by default?

I am currently running Android 6 but my phone has upgrades up to 7.1.1 (and 8 scheduled), so any solution that works for any of these versions would be good.

1
  • Sound or access to speakers is not a permission... I don't see how this would be possible without root and using Tasker and making a rule for every application on your phone to mute the audio when launched, except the ones you want to make sound, but I still potential conflicts when a "muted" application is active and another notification or desired sound is to occur, it likely will be muted as well.
    – acejavelin
    Aug 31, 2017 at 17:04

1 Answer 1

1

First, let's discuss some basic understanding of Android's audio frameworks.

In Android, there are a limited number of audio streams available via the AudioManager class. These audio streams are:

STREAM_ALARM
STREAM_DTMF
STREAM_MUSIC
STREAM_NOTIFICATION
STREAM_RING
STREAM_SYSTEM
STREAM_VOICE_CALL
STREAM_ACCESSIBILITY  (added in API 26)

Like acejavelin said in their comment, playing audio doesn't require a permission. Developers are responsible for using the appropriate stream to deliver sounds.

By default, pressing the volume control modifies the volume of the active audio stream. If your app isn't currently playing anything, hitting the volume keys adjusts the ringer volume.

Both games and music apps use STREAM_MUSIC.

Without rooting your phone, I don't see a way to selectively allow/deny apps from accessing audio streams.

There are a few best practices and guidelines for developers to follow when using audio streams outlined here. Unfortunately, I don't think they satisfy your exact needs at the level you desire.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .