rulururu

post Making a audio-cd the easy way

February 2nd, 2008

Filed under: Linux, Music — Kai @ 4:35 pm

Almost everybody know that situation only too well - you quickly have to burn an audio cd (e.g. for a party) and need all the tracks on cover.

I used to burn the cd with K3b or Brasero and then made a screenshot which I quickly edited to a fitting size with gimp and finally printed it.

Yesterday I found a better way when coming accross cdlabelgen, a great console-tool for making printable cd covers.

Usage can for example be:

cdlabelgen -c "Led Zeppelin" -s "Mothership" -o cover.ps

with parameter -f you can point to a file containing the tracknames.

cdlabelgen -c "Led Zeppelin" -s "Mothership" -f tracklist.txt -o cover.ps

I generate this file with a really short python script which I do pipe and writing the stream into a textfile:

ls -l | ./tracklist.py > tracklist.txt

#!/usr/bin/env python
from fileinput import input
import re
for line in input():
        s = line.find("- ")
        if s >= 0:
                line = line[s+2:line.find(".")]
                print line

Combination of all this to a small bash script gives you a great solution that saves a lot of time:

  • Generate tracklist
  • Get cd-title
  • Generate printable cover (postscript file)
  • Convert mp3 files to wav
  • Burn tracks using e.g. cdrecord

The script might look similar to this:

#!/bin/sh

#get title folder name
title=`${1} | awk 'BEGIN {FS="/"} {print $NF}'`
#generate list
ls -l ${1} | ./listfiles.py > tmp.txt
#generate label
cdlabelgen -c "`echo $title`"  -f ./tmp.txt -o ~/Desktop/label.ps
#delete list
rm tmp.txt
#convert mp3 to wav and burn
for i in *.mp3; do mpg123 -v -w "${i%mp3}wav" "$i"; done
cdrecord -dev=ATA:1,0,0 -eject speed=4 -pad -audio *.wav

If your printer is able to print postcript you can print directly like this:

cdlabelgen <args> | lpr -P<printername> -o Resolution=None -o PageSize=A4

You can add much more to your cover like images, date, etc. just have a look at the manpage.

1 Comment »

  1. It is very valuable phrase

    Comment by Slonysozy — November 11, 2011 @ 1:16 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment

ruldrurd
Powered by WordPress, Content and Design by Kai Bellmann
Entries (RSS) and Comments (RSS)