Skip to content

Instantly share code, notes, and snippets.

@kamikat
Last active November 2, 2015 02:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamikat/9426722 to your computer and use it in GitHub Desktop.
Save kamikat/9426722 to your computer and use it in GitHub Desktop.
Headphone burnin script
#!/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