Playing mp3 file every morning

251 views
Skip to first unread message

Soundpatrol

unread,
Jun 23, 2022, 7:03:53 AM6/23/22
to Automate
Hello,
This is my first attempt at building a Flow. It basically works but needs a few tweaks to meet my requirements.

Basically, I'd like the flow to play an mp3 file every morning.  The mp3 itself is several hours long.  Also, I always mute my phone when I go to bed, so I'd like this file to play even though the phone is on mute.  

Here is the flow I've created:

Screenshot_20220623-110730_Automate.jpg

(Note, it's activated from a desktop shortcut and the first Play Sound box is simply there to provide audible feedback that the button has been pressed). 

It does work but only if the phone is unmuted.  I did wonder if I could solve this by changing the Audio Stream to Alarm but this didn't help.  

For this flow, what Audio Stream would be the most appropriate? I did try and find documentation on this topic but couldn't find anything.

The other 'issue' I noticed was the volume level. I've set the playback to 60% but whilst playing the mp3, a notification came in to my phone and this caused the playback volume to increase sharply. How can I prevent this?

I'd also like any views you may have on making this flow as efficient as possible from a battery consumption POV?  I've set the Proceed value to Inexact (as the start trigger doesn't need to be too precise). Is there anything else I should be mindful of?

Currently, once this flow has done it's job for the day, it ends.  I then manually enable it for the next day. I assume if I wanted to make this a perpetual flow then I'd loop back the last box (Stop Sound) to the Await Time box, right? 

So, in summary, I want this mp3 to play even though my p[hone is muted (similar to the action of a normal alarm). Also, I don't want the specific volume level I set for playback (60%) to be affected by incoming notifications/calls etc. Finally, from a battery efficiency POV, is there anything I need to do to make this flow more efficient

Sorry, lots of questions however any help/feedback would be much appreciated - thanks. 

Henrik "The Developer" Lindqvist

unread,
Jun 24, 2022, 9:08:08 AM6/24/22
to Automate
  1. If the phone is muted i suspect it affect all audio streams in all apps, i doubt there's a way to circumvent that.
  2. For the first Sound play block i guess the Alarm or Notification audio stream would be most appropriate, Music for the second block.
  3. The Audio volume in a Sound play block should only affect the sound it plays, i don't know why an external notification would affect its volume, maybe the app showing that notification is increasing the "global" volume.
  4. A Time await block which only run once a day probably no affect on battery however its configured, whether it's Inexact or Exact.
  5. Yes, make a loop to make it run every day.

Soundpatrol

unread,
Jun 26, 2022, 11:50:28 AM6/26/22
to Automate

Hi Henrik, thank you very much for your reply.
>If the phone is muted i suspect it affect all audio streams in all apps, i doubt there's a way to circumvent that.
This is the bit I don't understand.  I have an app that produces white noise. If I have my phone on 'Mute' it still makes a sound. This is also true of my media player and, of course, if I use my Android built in alarm, this also makes a noise when the phone is on "Mute". After looking into this I can see that when my phone is on "Mute" it disables Ringtone, Notifications and System sound channels.  The Media sound channel is not muted.  So, is it possible that Automate's 'Play Sound' module can use the Media sound channel?  If this is possible then the above flow will work even if I set my phone to "Mute" - which is what I want.  Sorry if this is a silly question!   

>For the first Sound play block i guess the Alarm or Notification audio stream would be most appropriate, Music for the second block.
OK Thank you. Is there any documentation on audio streams and the differences between them? 
 
Thank you again for your reply. 

Henrik "The Developer" Lindqvist

unread,
Jun 26, 2022, 12:20:35 PM6/26/22
to Automate
There's no Media audio stream, but choosing the Music steam should behave as such, i.e. "music" content with "media" usage.

Does the sound pause or is muted? If the former then try using "None" as Audio focus.

Android version?
Reply all
Reply to author
Forward
0 new messages