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

[Feature request] Ignore apps (white noise) #7

Closed JanWaldhorn closed 1 year ago

JanWaldhorn commented 1 year ago

I use EasyNoise and every now and then (especially with the app in the background) the volume gets minimized by AutoMute, even though the sound is supposed to continue. I guess it would be easiest if EasyNoise or another app would not experience AutoMute as "Opt-Out" in the settings.

sommd commented 1 year ago

Hmm, it seems like Easy Noise uses a SoundPool to play its audio which for some reason isn't being detected by Auto Mute, so Auto Mute thinks there's no audio playing. I'll try to look into it when I next have time but this may be a bug in Android if SoundPool doesn't trigger the API that Auto Mute uses to detect audio playback.

sommd commented 1 year ago

Yeah, seems like SoundPool doesn't trigger AudioPlaybackCallback so there's no way for Auto Mute to detect that audio is playing. This is probably an Android bug so there's nothing that can be done unfortunately. :cry:

As a workaround you could disable the Auto Mute service when you want to use Easy Noise and re-enabled it after. Auto Mute provides a quick settings tile you can add which will make this a bit more convenient, but I know it's still not ideal sorry.

Auto Mute can't detect which app audio is coming from since Android doesn't provide this, so implementing any kind of per-app detection (as the title of this issue suggests) isn't possible either, so I'm going to close this issue.