Last active
November 2, 2015 02:33
-
-
Save kamikat/9426722 to your computer and use it in GitHub Desktop.
Headphone burnin script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Headphone burnin program use SoX tools | |
function wlog { | |
echo "[`date +%F\ %T`]" $@ | |
} | |
AUDIODEV=${AUDIODEV:-"default"} | |
wlog "Select device [$AUDIODEV]" | |
CYCLE_COUNT=${1:-`cat burnin.cycle 2>/dev/null`} | |
CYCLE_COUNT=${CYCLE_COUNT:-0} | |
function cleanup { | |
wlog "$CYCLE_COUNT cycle completed before exit." | |
echo $CYCLE_COUNT > burnin.cycle | |
exit | |
} | |
trap "cleanup" SIGINT SIGTERM | |
while true; | |
do | |
wlog "New 120min burn-in cycle started ($CYCLE_COUNT cycle completed)." | |
play -r 96000 -n synth 18:00 pinknoise pad 0 2:00 repeat 5 2>/dev/null 1>&2 | |
((CYCLE_COUNT++)) | |
echo $CYCLE_COUNT > burnin.cycle | |
wlog "Cycle $CYCLE_COUNT completed. Next cycle will start after 1h." | |
sleep 1h | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment