Sponsored Content
Full Discussion: Music cd burn
Top Forums Shell Programming and Scripting Music cd burn Post 302121187 by bog333 on Tuesday 12th of June 2007 09:52:51 AM
Old 06-12-2007
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/
 

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

burn cdrom with solaris

Hallo, who can help me to configure a scsi cd writer to my sun server enterprice 1000. 1. Hardware configuration 2. Burn program etc.. Please send me links or dokuments were i can get more infos about this theme. regards joerg (1 Reply)
Discussion started by: joerg
1 Replies

2. BSD

how to burn these files...?

How shall i burn these files?? cause i dont want to use about 200 MB on 1 cd.. so can i write these three files "bootonly,disk2 & miniinst" into 1 cd?? (4 Replies)
Discussion started by: D-iew
4 Replies

3. OS X (Apple)

burn clarification procedure

without having to write a mini series novel. i have read the disk utility / help / burn, innuendo solution. would the correct procedure to burn a Linux Mint Installation DVD/CD onto a USB device be: 1- select the CD/DVD. 2- click burn 3 - in the pop up window that follows choose the USB... (1 Reply)
Discussion started by: cowLips
1 Replies
SCRIPT(1)						    BSD General Commands Manual 						 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-k] [-q] [-t time] [file [command ...]] DESCRIPTION
The script utility makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. If the argument command ... is given, script will run the specified command with an optional argument vector instead of an interactive shell. Options: -a Append the output to file or typescript, retaining the prior contents. -k Log keys sent to program as well as output. -q Run in quiet mode, omit the start and stop status messages. -t time Specify time interval between flushing script output file. A value of 0 causes script to flush for every character I/O event. The default interval is 30 seconds. The script ends when the forked shell (or command) exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. The script utility works best with commands that do not manipulate the screen. The results are meant to emulate a hardcopy terminal, not an addressable one. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism). HISTORY
The script command appeared in 3.0BSD. BUGS
The script utility places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. It is not possible to specify a command without also naming the script file because of argument parsing compatibility issues. When running in -k mode, echo cancelling is far from ideal. The slave terminal mode is checked for ECHO mode to check when to avoid manual echo logging. This does not work when in a raw mode where the program being run is doing manual echo. BSD
June 6, 1993 BSD
All times are GMT -4. The time now is 04:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy