Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Burning Audio CDs - Another Way
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
brassj41
n00b
n00b


Joined: 28 Mar 2003
Posts: 39

PostPosted: Sat Sep 11, 2004 10:27 pm    Post subject: Reply with quote

will the cd's play in a regular cdplayer? I was under the impression that it had to be cdda and not wav
Back to top
View user's profile Send private message
STEDevil
Apprentice
Apprentice


Joined: 24 Apr 2003
Posts: 156

PostPosted: Sun Sep 12, 2004 7:48 pm    Post subject: Re: You've got it backwards Reply with quote

fireboy1919 wrote:
...keep the audio at CD quality - 48kHz


"DAT"-quality is 48kHz
CD-quality is always sampled at 44.1kHz
Back to top
View user's profile Send private message
mholtz
Tux's lil' helper
Tux's lil' helper


Joined: 04 Feb 2004
Posts: 110
Location: Ohio, USA

PostPosted: Tue Nov 09, 2004 3:59 am    Post subject: Reply with quote

How does this script handle mp3 files that are not 44.1kHz? Are you sure you don't need sox to resample in those cases?
Back to top
View user's profile Send private message
rhill
Retired Dev
Retired Dev


Joined: 22 Oct 2004
Posts: 1629
Location: sk.ca

PostPosted: Tue Dec 28, 2004 5:47 am    Post subject: Reply with quote

freebit50 wrote:


Code:

# get rid of of stuff in the filename that could fubar cdrecord

[...]

for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d '[0-9]'`; done
# oops, stripped the 3 from mp3....gotta add it back in
for i in *.[Mm][Pp]; do mv "$i" `basename $i .mp`.mp3; done



this'll kill any number ordering in the songs though. i suppose it's okay for a directory of random mp3's, but for an album it'll end up burning them alphabetically, won't it?
Back to top
View user's profile Send private message
Scratalacha
Tux's lil' helper
Tux's lil' helper


Joined: 24 Feb 2004
Posts: 127

PostPosted: Sun Apr 17, 2005 4:42 am    Post subject: Reply with quote

I saw this forum and found it helpfull in the creation of this script:

Code:


#!/bin/bash

export OPTIONS=""
export NORM=0
export num=0
export albumtitle="'VNV Nation - Matter and Form'"

for opt in "$@" ; do
   case ${opt} in
      --dummy|-d)
         echo "Running in dummy mode ..."
         OPTIONS="$OPTIONS -dummy"
         break;;
      --normalize|-n)
         echo "Normalizing on..."
         NORM=1
         break;;
      --help|-h)
         echo "To be continued..."
         exit 0;;
      *)
         echo "Unknown option '${opt}'"
         exit 1;;
   esac
done

echo "Converting files to WAV..."

for i in *.[MmOoMm][PpGg4][3GgAa]; do
   let "num += 1"
   mplayer -vo null -ao pcm -aofile  "track_`printf "%02d" $num`.wav" "$i" 2> /dev/null | grep -A1 -e 'Title: [0-9A-Za-z]' > "track_`printf "%02d" $num`.inf"
   if [ ! -s "track_`printf "%02d" $num`.inf" ]; then
      echo $i | sed -e 's/\[\+\\=\]*//' -e "s/\.[^\.]*$/\'/" -e "s/^/Tracktitle= \'/" >> "track_`printf "%02d" $num`.inf"      
   fi
   echo $num "-" $i      "Completed"      
done

for i in *.inf ; do sed -i -e "s/ Artist: /Performer= \'/" -e "s/ Title: /Tracktitle= \'/" -e "s/![\']$/\'/" -e "s/_/\ /" -e "s/'$//" -e "s/$/\'/" $i; done

if [ ! -z "$albumtitle" ]; then
   for i in *.inf; do echo "Albumtitle= "$albumtitle >> $i; done
fi

#create a time full calculator
#allow input of album title from CLI

if [ $NORM -eq 1 ]; then
   normalize *.wav
fi

cdrecord dev=ATAPI:/dev/hdc speed=4 driveropts=burnfree,varirec=0 -pad -audio -dao -v -text -useinfo $OPTIONS *.inf

rm track_*.wav &> /dev/null
rm track_*.inf &> /dev/null




This script allows one to burn mp3, ogg, and m4a files (and configurable to just about any other format) to an audio CD with cdtext.
It attempts to get the track information from the file, although if none is found, it falls back to the filename minus annoying characters.

Please let me know how this works, its a work in progress and as you can see i still have comments for code that i still need to add. Suggestions are welcome.
_________________
Anime ate my computer
Back to top
View user's profile Send private message
punter
Guru
Guru


Joined: 25 Nov 2002
Posts: 506

PostPosted: Sun Jul 24, 2005 6:02 pm    Post subject: Reply with quote

freebit50 wrote:
I love this little script!!! I was going to install k3b, but it was going to install a bunch of junk that I didn't want to wait for. This script works great, however, I added a little bit to it so cdrecord doesn't get messed on on weird filenames. I also made it so that in the end all the original files are back with no filename modifications. I also added comments. My CS teachers at school are always whining about comments and stuff.


Gotta go for a cruise with the new cd I just burned!!! Laters....

Code:

#!/bin/bash

#
# create backups so that we leave originals untouched
#
mkdir ./bak
cp *.mp3 ./bak

#
# get rid of of stuff in the filename that could fubar cdrecord
#
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr ' ' '_'`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d '-'`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d '_'`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d '('`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d ')'`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d '+'`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d "'"`; done
for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr -d '[0-9]'`; done
# oops, stripped the 3 from mp3....gotta add it back in
for i in *.[Mm][Pp]; do mv "$i" `basename $i .mp`.mp3; done

#
# decode mp3 to wav using lame
#
for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done

#
# normalize is a tool for adjusting the volume of audio files
# to a standard level.
#
normalize *.wav

#
# let us burn!!!
#
cdrecord dev=ATAPI:0,0,0 speed=16 -pad -audio -v -gracetime=2 *.wav

#
# get rid of temp files and restore originals
#
rm *.wav
rm *.mp3
mv ./bak/*.mp3 ./
rm -rf ./bak



warning: this script will DELETE _all_ your .MP3 files (but not .mp3 files) !!!!
i was too lucky to notice in time....
Back to top
View user's profile Send private message
ToeiRei
Veteran
Veteran


Joined: 03 Jan 2005
Posts: 1170
Location: Austria

PostPosted: Mon Feb 13, 2006 12:54 pm    Post subject: Reply with quote

To burn the mp3-files without using temp-files:

Code:

#!/bin/bash
for I in *.mp3
do
mpg123 --cdr - "$I" | cdrecord -v -speed=2 dev=ATAPI:0,0,0 -audio -pad -nofix -
done
cdrecord -v -speed=2 dev=ATAPI:0,0,0 -fix
eject

_________________
Please stand by - The mailer daemon is busy burning your messages in hell...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum