-
Senior Member
registered user
HOWTO: Script to burn MP3 files to CD
--I did some googling on the subject and adapted a script from one of the suse forums, as well as incorporating some code from another site. The object is to burn the mp3 files themselves to CDR (rather than converting to .wav) in order to get more than the usual 79 minutes of audio.
--This method works in my $30 Audiophase portable MP3 player (I think it was from Target.)
Requires: mkisofs, cdrecord.
Note: the variables CDR_DEVICE and CDR_SPEED are set in my environment, you should export them yourself either in this code (don't forget to chmod +x it) or in your own environment:
export CDR_DEVICE='0,1,0' #== Detect with ' cdrecord -scanbus '
export CDR_SPEED='16 driveropts=burnfree '
Code:
#!/bin/bash
#
# This is a CD-R script for burning mp3 files directly to CD.
# The mpg123 program converts mp3s to cdr format, and cdrecord burns
# the tracks on the CD.
#
cd /mnt/cdtemp/audio/
# cvt all fnames to locase:
##for i in *.[Mm][Pp]3; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
# cvt spaces to dashes
for i in *.mp3; do mv "$i" `echo $i | tr ' ' '-'`; done
# cvt to std extensions
for i in *.MP3; do mv "$i" "`basename "$i" .MP3`.mp3"; done
# When decoding 22khz MP3 files the output of mpg123 may be distorted. To
# fix this, use:
##for i in *.mp3; do mpg123 --rate 44100 --stereo --buffer 3072 --resync \
# -w `basename $i .mp3`.wav $i; done
/bin/ls
# Burn OTF as .wav (no space savings.:(
#for I in *.mp3
# do
# mpg123 --cdr - "$I" | \
# cdrecord dev=$CDR_DEVICE -audio -pad -v -speed=$CDR_SPEED -nofix gracetime=5 -
#done
#cdrecord -eject -v dev=$CDR_DEVICE gracetime=2 -fix
####
#> Best Regards,
#> Keith
# This does what we want, which is create an ISO with mp3 files to save spc:
mkisofs -J *.mp3 |\
cdrecord -eject -v dev=$CDR_DEVICE speed=$CDR_SPEED -data -
##mkisofs -J -o /tmp/mymp3s.iso /home/greg/mp3s/
#cdrecord dev=1,0,0 speed=16 /tmp/mymp3s.iso
Similar Threads
-
By ekr12 in forum Customising & Remastering
Replies: 1
Last Post: 04-06-2005, 09:30 PM
-
By Jens-FIN in forum General Support
Replies: 11
Last Post: 11-12-2004, 09:00 PM
-
By jch02140 in forum General Support
Replies: 4
Last Post: 06-18-2004, 02:22 AM
-
By fabriloup in forum General Support
Replies: 1
Last Post: 09-13-2003, 10:28 AM
-
By Hermanh in forum General Support
Replies: 16
Last Post: 01-30-2003, 03:10 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Supermicro CSE-732 Mid-Tower Server Chassis w/ Supermicro X10DRi 2x Xeon E5-2620
$325.00

HP ProLiant MicroServer Gen8 G1610T @2.3 GHz, 16GB, 712317-001 NO HDD/OS
$199.00

Supermicro E200-8D Barebones Server Chassis Xeon D-1528 X10SDV-6C-TLN4F 2x10GbE
$445.00

Supermicro CSE-937 3U Storage Chassis No CPU No HDD No Ram Tested & Reset
$129.99

Supermicro 2U X10DRU-i 2x E5-2680 v3 2.5ghz 32gb Ram 240gb SSD 2x GPU *READ*
$369.99

New Barebones Supermicro 5019D Server, 4C/8T Xeon D-2123T, 1U Rackmountable, 10G
$449.99

HP Proliant MicroServer HSTNS-5151 AMD Turion II Neo N40L CPU @ 1.50GHz 16Gb RAM
$174.99

Windows Server 2022 | Intel 18-Core Xeon | 32GB ECC DDR4 | 256GB SSD | 3TB HDD
$635.00

Nasuni NF-50 Supermicro Server, Atom CPU C2558, @ 2.40GHz, 8GB RAM-No HDD/OS/AC
$250.00

Supermicro 1U Network Server Appliance 16GB RAM 800GB SSD 6 LAN Ports Powers On
$450.00