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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-21-2004, 08:51 AM
|
#1
|
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109
Rep:
|
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?
|
|
|
11-21-2004, 06:37 PM
|
#2
|
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:
|
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.
|
|
|
11-22-2004, 07:44 AM
|
#3
|
Senior Member
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109
Original Poster
Rep:
|
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?
|
|
|
11-22-2004, 10:11 AM
|
#4
|
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:
|
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.
|
|
|
11-22-2004, 08:36 PM
|
#5
|
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:
|
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.
|
|
|
All times are GMT -5. The time now is 01:08 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|