From 59e5ffc91a75a28e36dd37a2643faadfaf5d3bdf Mon Sep 17 00:00:00 2001 From: Ratatoskr Date: Tue, 6 Feb 2024 17:43:54 +0100 Subject: [PATCH] Initial commit for play.sh script: - Create play.sh script to play an alarm sound with increasing volume using the mpv player. - The script iterates through different volume levels (20 to 100 in increments of 10). - Utilize pkill to terminate any previous mpv processes before starting a new one. - Incorporate comments for script header, loop, and process handling. - Add wait command to ensure the completion of each mpv process before starting the next one. - Created: 06.02.2024 - Description: Script to play an alarm sound with increasing volume. --- play.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 play.sh diff --git a/play.sh b/play.sh new file mode 100644 index 0000000..9d5d52e --- /dev/null +++ b/play.sh @@ -0,0 +1,27 @@ +#!/data/data/com.termux/files/usr/bin/zsh +# +# Alarm Volume Increase Script +# +# This script plays an alarm sound with increasing volume using the mpv player. +# It iterates through different volume levels, starting from 20 and increasing by 10 until reaching 100. + +# Header information +# Created: 06.02.2024 +# Description: Script to play an alarm sound with increasing volume. + +# Loop to play the alarm sound with increasing volume +for ((volume = 20; volume <= 100; volume += 10)); do + echo "Current volume: $volume" + + # Terminate any previous mpv processes + /system/bin/pkill mpv + + # Start the new mpv process with the specified volume + /data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg & + + # Wait for the completion of the current mpv process before starting the next one + wait +done + +# End of the script +