How Do I Burn MP3 onto an audio CD from Linux shell command prompt?

Recently I decided to burn selected MP3 files on an audio CD from command prompt.

ADVERTISEMENTS

First, you need to convert your mp3 (myfile.mp3) into .wav (myfile.wav) file:
$ mpg123 -w myfile.wav myfile.mp3
Use above command to convert all files to mp3

Then burn all .wav file on to the CD
# cdrecord -dev=ATA:1,0,0 -eject speed=4 -pad -audio *.wav

For more information see:

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source & DevOps topics via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
5 comments… add one
  • Rob Dec 7, 2005 @ 10:58

    You can use lame to encode the WAVs to MP3s. Once wav file created using cdparanoia you can use lame to encode the file wav to an MP3:

    lame myfile.wav myfile.mp3

    lame also supports bitrate option for example to use 256 kilobytes bitrate you can use:

    lame -b 256 myfile.wav myfile.mp3

    Read man page of lame for all supported options.

  • Kan Jun 15, 2007 @ 23:30

    to convert all mp3 files at once, do:
    for i in *.mp3; do mpg123 -v -w "${i%mp3}wav" "$i"; done

    • ANonymous Jul 16, 2010 @ 22:54

      nice

  • Jake Apr 1, 2011 @ 21:58

    To convert all mp3 files, accounting for spaces in names and correcting the “filename.mp3.wav” naming, try:

    IFS=$'n' ; for i in $(ls |grep mp3$) ; do echo $i ; mpg123 -w `basename $i .mp3`.wav $i ; done
    • El_Siurell Apr 22, 2012 @ 10:10

      You did not set back IFS:
      add last command :
      IFS=$’ nt’

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.