#!/bin/sh # # $NetBSD: mod2wav,v 1.3 2003/11/25 22:16:28 wiz Exp $ # # I wrote this shell script long ago to be able to master CDs from modules # in Un*x using gmodplay. -Ben CMD=$(basename $0) if [ -z "$*" ] then echo " Usage: $CMD for example \"$CMD funky.xm\" would create funky.xm.wav " exit fi sox -V 2>&1 | grep sox >/dev/null 2>&1 if [ $? -ne 0 ] then echo " FATAL: I can't find sox in your path. Is it installed? " exit fi WAVDIR=$(dirname "$*") WAVNAME=$(basename "$*").wav echo -e "$* -> $WAVDIR/$WAVNAME\c" echo -e " [step 1]\c" gmodplay -n -w "$*" >/dev/null 2>&1 if [ $? -ne 0 ] then echo " FATAL: gmodplay returned an error. " exit fi echo -e " [step 2]\c" chmod a+r output.raw sox -t raw -r 44100 -s -w -c 2 output.raw "$WAVDIR/$WAVNAME" >/dev/null 2>&1 if [ $? -ne 0 ] then echo " FATAL: sox returned an error. You may need to remove output.raw " exit fi echo -e " [step 3]\c" rm -f output.raw echo " Finished!"