shithub: sox

Download patch

ref: 0a2fea5f9b9ef5559b23396a0763c659d96858c2
parent: 3af10ea0b4079495d640e9c615ce15cbdbb49460
author: Ulrich Klauer <ulrich@chirlu.de>
date: Mon Jan 28 20:17:34 EST 2013

Simplify scripts/alert.sh

--- a/scripts/alert.sh
+++ b/scripts/alert.sh
@@ -33,15 +33,8 @@
   $SOX -e mu-law -r 8000 -n -t raw - synth 0.25 sine $freq gain -3 >> 2tones.ul
 done
 
-rm -f alert.ul     # Make sure we append to a file that's initially empty
-iterations=60      # 60 copies of 2tones.ul (0.5 sec) gives 30 secs of audio
-
-while [ $iterations -ge 1 ]; do
-  cat 2tones.ul >> alert.ul
-  iterations=`expr $iterations - 1`
-done
-
-$SOX -c 1 -r 8000 alert.ul alert.au    # Add a file header
-rm 2tones.ul alert.ul                  # Tidy up intermediate files
+$SOX -c 1 -r 8000 2tones.ul alert.au repeat - trim 0 30
+                   # Repeat to fill 30 seconds and add a file header
+rm 2tones.ul       # Tidy up intermediate file
 
 $SOX alert.au -d