sommd / auto-mute

Automatically mute or unmute your media volume based on the type of audio playing for Android 8.0 and up.
GNU General Public License v3.0
15 stars 1 forks source link
android app audio

Auto Mute License: GPL v3

App Icon

Automatically mute or unmute your media volume based on the type of audio playing for Android 8.0 and up.

Auto Mute can be configured to automatically unmute media audio or show the media volume control when music, media, assistant or game audio starts playing. It can also automatically mute after audio stops playing.

Get it on Google Play

Or download the latest release.

Screenshots

Auto Mute Settings Screenshot Auto Unmute Settings Screenshot Status Notification Screenshot

FAQ

How do I hide the notification?

Android 8

Notification Settings > Importance > Low

Android 9

Notification Settings > Behavior > Show silently and minimize

Android 10 and up

Notification Settings > Minimize

Why does \ count as music when it's not?

Auto Mute uses the audio stream's AudioAttributes (specifically the usage and contentType properties) to identify the type of audio. AudioAttributes was only added in Android 5.0, so not all apps have been updated to use it. Even if an app does use AudioAttributes, if the app sets the usage and contentType incorrectly Auto Mute may misidentify the audio type.

Why doesn't it detect the audio type from the app?

Android only passes an anonymized copy of each AudioPlaybackConfiguration to the app, so it's impossible to detect which audio stream is coming from which app.

Why does Auto Mute require Android 8.0 and up?

The API used to monitor audio streams ([AudioManager.getActivePlaybackConfigurations()](https://developer.android.com/reference/android/media/AudioManager.html#getActivePlaybackConfigurations()) and AudioManager.AudioPlaybackCallback) was only added in Android 8.0 (API 26).

Contributing

  1. Fork and/or clone the repo and open it in Android Studio.
  2. Make some changes and commit.
  3. Create a pull request.

License

Copyright (C) 2024 Dana Sommerich

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

See LICENSE.

Google Play and the Google Play logo are trademarks of Google LLC.