[b09f68]: tools / sound / sound2ub.sh Maximize Restore History

Download this file

sound2ub.sh    28 lines (17 with data), 531 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# use sox to convert a .wav file to the correct .ub file for Asteroids3D
PATH="/bin:/usr/bin:/usr/sbin"
FILENAME="$1"
if [ "$FILENAME" = "" ]; then
echo "usage: sound2ub <name>.<ext>"
exit
fi
FIRSTNAME=`echo $FILENAME | cut -f 1 -d .`
NEWFILE="$FIRSTNAME.ub"
echo "If everything goes okay, you should hear the same sound twice."
echo "playing $FILENAME..."
play $FILENAME
echo "Transforming $FILENAME...to $NEWFILE"
sox $FILENAME -c 1 -r 8000 $NEWFILE rate
echo "playing $NEWFILE"
play -c 1 -r 8000 $NEWFILE