Deactivate Speaker when headphones are connected

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
Oelle
Posts: 2
Joined: 22 May 2019 12:03

Deactivate Speaker when headphones are connected

Post by Oelle » 22 May 2019 19:20

Hi,
I'd like to deactivate the speaker when the headphones are connected (e.g. for ringtone or notifications).
I have a Samsung Galaxy A40 (Android 9).
I tried the following:

Trigger: Cable headphone is connected
Condition: Speaker is on
Action: Turn-Off speaker

But it does not work. Does anyone has an idea?

Thanks!

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Deactivate Speaker when headphones are connected

Post by Desmanto » 25 May 2019 15:54

This depends on the ROM of the phone. Most phones will still play the ringtone/notification on speaker. There is an app called Sound About which can redirect the sound. But It is better you just set the ringtone/notification to zero when headset is connected. You can create another flow for notification/incoming call to play certain sound file as the ringtone/notificatiaon replacement.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Oelle
Posts: 2
Joined: 22 May 2019 12:03

Re: Deactivate Speaker when headphones are connected

Post by Oelle » 28 May 2019 04:50

Hi,
I have Android 9 and SoundAbout does not work...
Any other idea?
Thanks!

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Deactivate Speaker when headphones are connected

Post by Desmanto » 01 Jun 2019 19:44

That means you have to use the alternative method I posted above, set your ringtone silent. Then create additional sound action with trigger Notification on Statusbar Display and Incoming Call. It is more complicated, but it works better. In total, if you separate the flow, you will need 5 flows.
1. Trigger Wired headset plugged, action set ringtone/notification volume to zero (you can optionally store the audio volume first before setting it to zero) and enable flow 3, 4, 5
2. Trigger Wired headset unplugged, action set ringtone/notification volume to the default level (optionally, simply restore Audio volume), disable flow 3, 4, 5
3. Trigger Incoming Call - Ringing, action sound, choose the ringtone to play
4. Trigger Incoming Call - Off-hook, action stop sound (to stop the ringtone)
5. Trigger Notification on Statusbar Displayed, action sound, choose a short notification sound.

If you combine them using multiple parallel expression, you only need 2 flows, where 1+2, then 3+4+5.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Locked