LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-21-2004, 08:51 AM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 50
Burn audio cd


I have a dir with a few mp3-files that I want to burn to an audio-cd.

I tried to do something with cdrecord but I first got an error and then I tried to as the error said and use the -pad-option but then the cd just got "fsck"ed up (it's a joke, not fsck).

Code:
$ cdrecord dev=/dev/cdrom -audio file1.mp3 file2.mp3 [...] fileN.mp3
Cdrecord 2.00.3 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
cdrecord: Cannot allocate memory. WARNING: Cannot do mlockall(2).
cdrecord: WARNING: This causes a high risk for buffer underruns.
cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.7'
Device type    : Removable CD-ROM
Version        : 0
Response Format: 1
Vendor_info    : 'SAMSUNG '
Identifikation : 'CD-R/RW SW-224B '
Revision       : 'R201'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
Driver flags   : MMC-2 SWABAUDIO BURNFREE 
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
cdrecord: Bad audio track size 5720407 for track 01.
cdrecord: Audio tracks must be at least 705600 bytes and a multiple of 2352.
cdrecord: See -pad option.
Then with the -pad
Code:
$ cdrecord dev=/dev/cdrom -audio -pad file1.mp3 file2.mp3 [...] fileN.mp3
Cdrecord 2.00.3 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
cdrecord: Cannot allocate memory. WARNING: Cannot do mlockall(2).
cdrecord: WARNING: This causes a high risk for buffer underruns.
cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.7'
Device type    : Removable CD-ROM
Version        : 0
Response Format: 1
Vendor_info    : 'SAMSUNG '
Identifikation : 'CD-R/RW SW-224B '
Revision       : 'R201'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
Driver flags   : MMC-2 SWABAUDIO BURNFREE 
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.
Starting to write CD/DVD at speed 24 in real TAO mode for single session.
Last chance to quit, starting real write    0 seconds. Operation starts.
Turning BURN-Free off

WARNING: padding up to secsize.
Track 01: Total bytes read/written: 5720407/5722416 (2433 sectors).

WARNING: padding up to secsize.
Track 02: Total bytes read/written: 4660163/4661664 (1982 sectors).

WARNING: padding up to secsize.
Track 03: Total bytes read/written: 4049828/4050144 (1722 sectors).

WARNING: padding up to secsize.
Track 04: Total bytes read/written: 6453248/6453888 (2744 sectors).

WARNING: padding up to secsize.
Track 05: Total bytes read/written: 22055249/22057056 (9378 sectors).

WARNING: padding up to secsize.
Track 06: Total bytes read/written: 4225986/4226544 (1797 sectors).

WARNING: padding up to secsize.
Track 07: Total bytes read/written: 3578984/3579744 (1522 sectors).
How shall I do?
 
Old 11-21-2004, 06:37 PM   #2
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Do you mean you want to create an audio CD with each track containing an mp3 file?

The good news: you can burn such a CD, just the way as you did it using the -pad option.

And now the bad news: no player will play those tracks, since standard audio CD tracks should contain raw PCM data, and not mp3 :-(.

So, either you write those mp3s onto a data CD, or you extract them into raw PCM, and burn an audio CD.

Last edited by J_Szucs; 11-21-2004 at 06:40 PM.
 
Old 11-22-2004, 07:44 AM   #3
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Yeah I thought that the type may be the problem. But then my question is: how can I convert from mp3 to whatever you told me to use (I have read about so many types so I can't remember them all, wav, cdda, etc. So many terms. :P).

How shall I burn when I have the correct type that can be played in a standard cd-player?
 
Old 11-22-2004, 10:11 AM   #4
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
You have to do four things:

1.) Decode the mp3 files to wav:
lame --decode fileN.mp3 fileN.wav

2.) Resample the wav files to 44.1kHz bitrate
sox fileN.wav -r 44100 fileN-new.wav resample

3.) Normalize the volume
normalize -m *new.wav

4.) Burn the files onto a CD; you already know how to do it:
cdrecord dev=/dev/cdrom -audio -pad file1-new.wav file2-new.wav [...] fileN-new.wav

The above should work, though I never did it myself; these are all the result of some google searching I did.

Last edited by J_Szucs; 11-22-2004 at 10:16 AM.
 
Old 11-22-2004, 08:36 PM   #5
J_Szucs
Senior Member
 
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
OK, here is a little script of mine that is supposed to automatize audio CD creation using lame, sox, normalize and cdrecord:
Code:
if [ -z "$1" ] ; then
  echo "Missing parameter: Location (directory) of album"
  exit
fi
if [ ! -d "$1" ] ; then
  echo "Error: album location $1 does not exist"
  exit
fi
# Decoding mp3s and resampling them
for file in `find $1 -name "*.mp3"` ; do
  echo "Decoding $1 to $1.wav:"
  lame --decode "$file" "$file.wav"
  echo "Resampling $file.wav to $file-new.wav"
  sox "$file.wav" -r 44100 "$file-new.wav resample
  rm "$file.wav"
done
# Normalizing volume
normalize -m "$1/*-new.wav"
echo "The files should be ready to burning onto CD now:"
ls -l "$1"
echo "Do you want to burn them now?"
read choice
case choice in
[Yy]) cdrecord dev=/dev/cdrom -audio -pad `find $1 -name "*-new.wav"` ;;
*) exit ;;
esac 
echo "End"
The script should be used as follows:
/path/to/script /path/to/album

If you find that the script could be handy, then feel free to debug it, as I wrote it in 5 minutes and I never tested it.
Also it might need some addition to handle spaces and special characters in filenames, which could cause some trouble in the present state of the script.
A last note: the linuxquestions.org forum software always replaces the double "[" and "]" characters in the if constructs of my codes, so you must possibly correct the if construct syntax you find in my post.

Cheers

Edit:
This time the linuxquestions.org forum software totally ruined my code, so I had to replace double "[" and "]" characters by single ones just to make the script readable here. So, please double those characters in the if constructs before using the code.

Last edited by J_Szucs; 11-22-2004 at 08:51 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't burn audio cds minm Linux - Newbie 2 03-02-2005 04:11 PM
Can't burn audio cd's!!! theMonkeY Slackware 6 09-18-2004 03:54 AM
k3b error with audio cd burn (no prob with iso burn) bluem Linux - Newbie 1 04-16-2004 09:05 AM
Mp3/audio burn commandline neurotic Linux - Software 0 08-05-2003 09:58 AM
how do i burn audio cd's the anti-riced Linux - General 8 06-20-2003 08:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration