Bog,
Since I don't know your application, I could not test this
script -- see if it works for you:
Code:
#!/bin/bash
#Saves the current directory
mSaveDir=`pwd`
#Save the list of "ogg" and "wav" files
mListogg=""
mListmp3=""
for mFileName in $@
do
j=`echo $mFileName | cut -f2 -d '.'`
if test $j = 'ogg'
then
mListogg=${mListogg}" "$mFileName
fi
if test $j = 'mp3'
then
mListmp3=${mListmp3}" "$mFileName
fi
done
#make the "/tmp/cd_temp/" directory
mkdir /tmp/cd_temp
#go at the files directory
cd /tmp/cd_temp
#convert the ogg file in wav file
for mFileName in ${mListogg}
do
mBaseName=`basename $mFileName .ogg`
mFullogg=$mSaveDir"/"$mBaseName".ogg"
mFilewav=$mBaseName".wav"
sox $mFullogg $mFilewav
done
#convert the mp3 file in wav file
for mFileName in ${mListmp3}
do
mBaseName=`basename $mFileName .mp3`
mFullmp3=$mSaveDir"/"$mBaseName".mp3"
mFilewav=$mBaseName".wav"
mpg123 -w mFilewav ${mFullmp3}
done
#burn CD
cdrecord dev=ATA:0,0,0 -eject speed=2 -pad -audio *.wav
#erase the temporary file
rm -r /tmp/cd_temp/