Allow a sound, even if DND/Silence is on.

shack6731

New member
I have a trigger on a specific notification. As action I play a sound. However, if DND or Silence is on then I will not get the sound.

Would it be possible to turn off DND and turn off Silence, then play the sound, and then turn on DND/Silence again (but only if any of them was off to begin with)?
 

hsurB

Well-known member
When configuring play sound action at the bottom of pop up window there is option to select audio stream. Try changing it to media, I think it should be playing a sound then (as long as media's volume is not equal to 0).
If you want you could start a macro with action set variable to save current media volume, then change it to whatever you want (how loud you want the sound to be), play a sound and then change media volume back to variable value (it has to be integer variable).
This way you will ignore dnd/silent mode completely.
In case it doesn't work, let us know and I will remake it taking dnd/silent mode into consideration
 

Qarboz

Well-known member
I have a trigger on a specific notification. As action I play a sound. However, if DND or Silence is on then I will not get the sound.

Would it be possible to turn off DND and turn off Silence, then play the sound, and then turn on DND/Silence again (but only if any of them was off to begin with)?
As a trigger use the notification that is to sound
In the actions start the playback of the ringtone you are interested in using the media/music stream
As a constraint DND active or Silence active
 

shack6731

New member
When configuring play sound action at the bottom of pop up window there is option to select audio stream. Try changing it to media, I think it should be playing a sound then (as long as media's volume is not equal to 0).
If you want you could start a macro with action set variable to save current media volume, then change it to whatever you want (how loud you want the sound to be), play a sound and then change media volume back to variable value (it has to be integer variable).
This way you will ignore dnd/silent mode completely.
In case it doesn't work, let us know and I will remake it taking dnd/silent mode into consideration

That's very clever. I will try and let you know how it goes.
 

shack6731

New member
When configuring play sound action at the bottom of pop up window there is option to select audio stream. Try changing it to media, I think it should be playing a sound then (as long as media's volume is not equal to 0).
If you want you could start a macro with action set variable to save current media volume, then change it to whatever you want (how loud you want the sound to be), play a sound and then change media volume back to variable value (it has to be integer variable).
This way you will ignore dnd/silent mode completely.
In case it doesn't work, let us know and I will remake it taking dnd/silent mode into consideration
I think I've followed your instructions, but when setting the device to silent and/or DND, there is no sound. Everything else is working as expected.

Attaching my test
 

Attachments

  • Screenshot_2023-11-28-17-01-46-892_com.arlosoft.macrodroid-edit.jpg
    Screenshot_2023-11-28-17-01-46-892_com.arlosoft.macrodroid-edit.jpg
    105.7 KB · Views: 6

hsurB

Well-known member
First, confirm you have changed audio stream of action play sound to media.
Second - try adding wait before next action (10s or the duration of your sound) before setting the volume back to variable's value.
If you run your macro looking like that and you start it with media volume =0 it will change volume to 0 shortly after play sound action is executed, its too quickly
 

Attachments

  • Screenshot_20231128_172514_MacroDroid.png
    Screenshot_20231128_172514_MacroDroid.png
    354.6 KB · Views: 3
Last edited:

shack6731

New member
First, confirm you have changed audio stream of action play sound to media.
Second - try adding wait before next action (10s or the duration of your sound) before setting the volume back to variable's value.
If you run your macro looking like that and you start it with media volume =0 it will change volume to 0 shortly after play sound action is executed, its too quickly
I have now changed audio stream to media - and it is working. Thank you!
I don't think waiting before next action is needed, because there is a setting on audio to make it block next action until complete. I have tried waiting 5 seconds, but as far as I can see it doesn't make any difference.
Attaching current macro.

The only thing missing is that I would like to have the sound set to 50% if DND is active. And 100% otherwise. Do you know if this is possible? And how to do it?
 

Attachments

  • Screenshot_2023-11-29-09-52-50-678_com.arlosoft.macrodroid.jpg
    Screenshot_2023-11-29-09-52-50-678_com.arlosoft.macrodroid.jpg
    132.3 KB · Views: 3

shack6731

New member
I think I solved the last part myself.
 

Attachments

  • Screenshot_2023-11-29-10-10-53-933_com.arlosoft.macrodroid-edit.jpg
    Screenshot_2023-11-29-10-10-53-933_com.arlosoft.macrodroid-edit.jpg
    81.7 KB · Views: 4

hsurB

Well-known member
Yeah. I forgot about wait until complete, wait before next action isn't needed then.
You could either use if clauses as you did to perform different actions based on device's state (dnd mode in this case) or you can add both actions, click each of them and add constraints directly to single action.
Set volume - 50% (priority mode/dnd enabled)
Set volume - 100% (priority mode/dnd disabled)
You need to test it on your own cause there are few options you can use this constraint (block all, priority notifications, allow all etc.). It all depends on how you use this mode. Remember you could also use OR constraint to add all these constraints to one action. Then it will be performed if one of condicions is met
Glad we could help, if there is anything you'd like to improve, feel free to ask here and we will try to figure it out. ;)
 
Last edited:

shack6731

New member
You could either use if clauses as you did to perform different actions based on device's state (dnd mode in this case) or you can add both actions, click each of them and add constrainst directly to single action.
Thank you, I didn't know about that. And thank you for helping me.
 

shack6731

New member
One more thing. How can I make a constraint based on if the phone is in silent mode? I can not find this constraint in MD.
 

hsurB

Well-known member
Here
 

Attachments

  • Screenshot_20231129_121554_MacroDroid.png
    Screenshot_20231129_121554_MacroDroid.png
    509.2 KB · Views: 4
  • Screenshot_20231129_121558_MacroDroid.png
    Screenshot_20231129_121558_MacroDroid.png
    189.9 KB · Views: 4

shack6731

New member
Thanks. I have put a Ringer Volume=Silent constraint on Volume Change 50%. I press activate the Silent Mode on my phone. But the log say: Volume Change (Media/Music=50%) did not invoke because constraint failed. It seems the Ringer Volume constraint is not the same as Silent Mode?
 

hsurB

Well-known member
I am honestly not sure. I haven't really used them too often myself.
What if you just checked what exactly silent mode does on your phone, like whats specific for it - if it for exemple changes system/ringer volume = 0 and used this as as constraint instead? For exemple ringer volume lower than 10%
 

shack6731

New member
I am honestly not sure. I haven't really used them too often myself.
What if you just checked what exactly silent mode does on your phone, like whats specific for it - if it for exemple changes system/ringer volume = 0 and used this as as constraint instead? For exemple ringer volume lower than 10%

It seems the Silent Mode doesn't change the other volume settings at all. But no worries, I'll usually use the DND setting.
 
Top