Files
bin/mp32cda
2011-02-22 21:41:36 +01:00

49 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
set -x
# Generate cdrdao-toc-file from an directory with mp3-files
# and decode mp3 files to wav
# Variables
. /etc/dvd-scripts.env
burndir=/dat/tmp/burn # Directory, where all the file are put in
list=$burndir/list.txt # File
toc=$burndir/cd.toc # cdrdao-toc-file
cdspeed=24 # Writespeed of CD-Writer
cddriver=generic-mmc-raw
ScriptDir=/usr/local/src/scripts
mp3id2toc=mp3id2toc # program, that generates the toc from the id-tags
mp32wav=mp32wav # program, that decodes the mp3 files to wav
[ -d "$burndir" ] || mkdir "$burndir"
rm "$burndir"/*
# check if a parameter for directory with source files is there
mp3dir=.
[ -d "$1" ] && mp3dir="$1"
# generate toc file with cd-text from id-tags for cddao
$mp3id2toc "$toc" "$mp3dir"
# convert mp3-files to wave format
echo "
Die mp3-files werden in dieser Reihenfolge decodiert und
auf die CD gebrannt. "
$mp32wav "$mp3dir" "$burndir"
# Write the wav-files to the cd
cd $burndir
cat $toc
#cdrdao write --simulate --device $CD_DEVICE_SCSI --speed $cdspeed --driver $cddriver -v 3 -n $toc
cdrdao write --device $CD_DEVICE --speed $cdspeed --driver $cddriver -v 3 -n $toc
#rm $list
#rm $toc
eject