Play Random Sounds On Lock and Unlock

by Steven Moore

Version 1 (September 10, 2020)

Download (11 downloads)

Plays a random sound from a specified directory when device is locked or unlocked.

The "Choose Directory" flows let the user choose directories containing the desired sounds.

The "Play Random Sound" flow chooses a random file from the specified directory (prompting the user for one if it hasn't been specified yet) and plays it. A notification with the sound filename is shown and stops the sound when tapped.

NOTES:
The specified directory mustn't be empty and may only contain sound files. Otherwise the flow may fail.
Contents of the directory are read anew every time the flow is activated, so changes are reflected immediately.