Burning

From chaoswiki
Jump to navigation Jump to search

Just a practicle simple script for local file burning. It must be executed as root because of cdrecord.

Code: burn.sh
#!/bin/bash

case "$1" in
        clean)
                option="dev=ATA:1,0,0 blank=fast -v"
                cdrecord $option
        ;;
        file)
                mkisofs -r -R -J -l -allow-leading-dots "$2" | cdrecord dev=ATA:1,0,0 -v --eject  -
        ;;
        iso)
                echo "$2 gets burned"
                option="-v -eject dev=ATA:1,0,0 $2"
                cdrecord $option
        ;;
        sound)
                DIRECTORY="/root/tmp/sound/"
                cd "$2"
                cp * "$DIRECTORY"
                cd $DIRECTORY
                mkdir -p wav
                for i in *; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader:file="wav/${i}.wav" "$i" ; done
                normalize -m $DIRECTORY/wav/*.wav
                cdrecord -v dev=ATA:1,0,0 -audio -pad wav/*.wav
                rm wav/*.wav
                rm *
        ;;
        *)
        echo "(clean|file|iso)"
        ;;
esac


Any Suggestions?