06-12-2007
3,
0
Join Date: Jun 2007
Last Activity: 29 August 2007, 7:10 PM EDT
Posts: 3
Thanks Given: 0
Thanked 0 Times in 0 Posts
Music cd burn
Allo.
I do a program using shell script to burn cds and dvds because I don't want to install one with kde or gnome dependance. I want to optimize one of my shell script. this shell script is to burn music cds. I juste have to go in shell and write :
burn_cd_music audio1.mp3 audio2.mp3 audio1.ogg audio1.wav
and the shell script copy file in /tmp/cd_temp, converte them in .wav and burn the cd. It's fonctionnal, but I don't want to have temporary file.....
Can I use pipe or buffer to do that, and how?
Sorry for my english, if you don't understand, I will try to better explain
Give me you ideas
My script is:
#!/bin/bash
#do a liste of the mp3 files and one for the ogg file
for i in $@
do
j=`echo $i | cut -f2 -d '.'`
if test $j = 'ogg'
then
list1="$list1 $i"
fi
if test $j = 'mp3'
then
list2="$list2 $i"
fi
done
#copy the file in /tmp/cd_temp (I don't want to do this)
mkdir /tmp/cd_temp
for i in $@
do
cp $i /tmp/cd_temp/
done
#go at the files directory
cd /tmp/cd_temp
#convert the ogg file in wav file
for i in list1
do
sox `basename $i .ogg`.ogg `basename $i .ogg`.wav
rm `basename $i .ogg`.ogg
done
#convert the mp3 file in wav file
for i in list2
do
mpg123 -w `basename $i .mp3`.wav $i
rm `basename $i .mp3`.mp3
done
#burn CD
cdrecord dev=ATA:0,0,0 -eject speed=2 -pad -audio *.wav
#erase the temporary file
rm -r /tmp/cd_temp/