This commit includes improvements to the 'play.sh' script: - Added a 'while' loop for volume 100, ensuring continuous playback with the specified volume. - Changed the volume increment loop to start from volume 20 and increase by 10 in each iteration. - Improved comments and formatting in the script. The changes aim to enhance the script's functionality by addressing volume-related issues and providing better clarity in the script structure.
32 lines
1.0 KiB
Bash
32 lines
1.0 KiB
Bash
#!/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
|
|
|
|
while [[ volume == 100 ]]; do
|
|
/data/data/com.termux/files/usr/bin/mpv --replaygain=track --volume="$volume" /data/scripts/your-new-morning-alarm.ogg &
|
|
done
|
|
done
|
|
|
|
# End of the script
|
|
|