Fade music; end audio & Bluetooth

by Paddy Landau

Version 1 (March 28, 2016)

Download (187 downloads)

Fall asleep to your music before fading out the volume and turning off the audio player and Bluetooth. You specify the sleep time, and how much of that time will be reserved for fading out. This Flow:
1. Waits for the specified sleep time;
2. Fades out the volume before the end (unless you specify no fade time);
3. Turns off the audio player;
4. Reinstates the original volume;
5. Turns off Bluetooth.

For example, if you specify 30 minutes to sleep with 2 minutes to fade, the Flow waits 30 minutes, fading out the volume over the last 2 minutes; turns off the audio player; reinstates the original volume; and finally turns off Bluetooth.

The "original volume" is the volume from the very beginning (after you have specified your sleep and fade times), so you can safely lower the volume during the "wait" phase and still have the volume reinstated after the player has stopped.

If you change the volume during the fade period, the fade algorithm will override your choice sooner or later. Although this could be fixed, the programming effort isn't worth it — considering that you should be asleep already.

The time control isn't exact, and depends partly on how finely your device allows the volume to be controlled during the fade — but that shouldn't matter, as you are hoping to be asleep by then!

Why have I included the function to disable Bluetooth? My Bluetooth speaker automatically turns off after the device is disconnected, thereby reducing its battery use. If you don't want Bluetooth to be turned off, delete the Flow's very last block (i.e. "Disable BT").

Permissions required:
• System Settings (change volume; stop audio player)
• Connectivity (turn off Bluetooth)

5.0 average rating from 1 reviews

5 stars
4 stars
3 stars
2 stars
1 star

Rate and review within the app in the Community section.