Here are the steps I took to burn audio cd's from my mythmusic library. This is a pretty cheesy hack if you will but it works for me. As you will notice, all the tools to make an audio cd from mythmusic already existed. All I did was tie them together. "I'm just a shoe lace"
First install these packages
--> sox
--> mpg321
--> normalize-audio
All of these packages installed properly under KnoppMyth R5A16. I'm not sure about other versions.
--> mp3cd - This at one time was in the Debian repositories but is no longer that I can tell. So cd into your home directory and
$wget
http://outflux.net/software/pkgs/mp3cd/ ... 024.tar.gz
then extract the file
$tar xvfz mp3cd-1.024.tar.gz
follow the install instructions within the mp3cd-1.024 directory. (or you can cheat as I did and copy the mp3cd file to /usr/bin)
$su
password
#cp mp3cd-1.024/scripts/mp3cd /usr/bin/mp3cd
Once the packages are installed create a symlink from /usr/bin/normalize-audio to /usr/bin/normalize
So as root do
#ln -s /usr/bin/normalize-audio /usr/bin/normalize
now download the next needed file
$wget
http://www.foofus.net/jmk/mythtv/m3u2myth.pl
copy this file to /usr/bin
$su
password
cp m3u2myth.pl /usr/bin/m3u2myth.pl
Now using your favorite editor create a file called burncdaudio.sh
----------------------------------------------------------------------------------------------
#! /bin/bash
# (c) 2005 Jeff Bushnoe
# Version 0.1
#
# ----------------------------------------------------------------------------
# Script to create Audio Cd's from MythMusic Library
# ----------------------------------------------------------------------------
#
# Programs and Scripts used.
# Sox --> apt installable
# mpg321 --> apt installable
# normalize --> apt installable (In Debian a link from /usr/bin/normalize-audio to /usr/bin/normalize needs to be created)
# cdrdao --> apt installable
# m3u2myth --> by Joseph N. Mondloch
# mp3cd --> by Kees Cook ( no longer in the apt repositories. you can get it here
http://outflux.net/software/pkgs/mp3cd/ ... 024.tar.gz
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games"
export PATH
# Create Temporary Directory
echo Making Temporary Work Directory,
mkdir /myth/cdaudio/tmp
# Change into Directory where MythMusic Library resides.
echo Changing into MythMusic Library Directory,
cd /music
# This Script converts the default playlist in MythMusic to a playlist file.
echo Converting MythMusic default playlist,
perl m3u2myth.pl --toM3U --file /myth/cdaudio/tmp/cdaudio.pls --id 1
# This Script reads the newly created playlist, converts the mp3's to wavs, checks the wav's for proper formatting, level's the volume for each wav, and then writes the disc.
echo Creating wavs and burning disc.
perl mp3cd -s clean -t /myth/cdaudio/tmp -d /dev/dvd /myth/cdaudio/tmp/cdaudio.pls
# Remove Temporary directory and files.
echo Removing Temporary directory and files.
rm -fr /myth/cdaudio/tmp
echo #############################
echo Finished
echo #############################
----------------------------------------------------------------------------------------------
Some editing needs to be done to match your system.
I created a folder called cdaudio under the myth directory, but it can be whatever you desire. Remember that the mythtv user has to have write privlages. This will be the working directory for the script.
$mkdir /myth/cdaudio
You'll need to change this line so it'll change into where you have your music stored. I have mine in /music.
# Change into Directory where MythMusic Library resides.
echo Changing into MythMusic Library Directory,
cd /music
copy this newly created/edited file to /usr/bin
#cp burncdaudio.sh /usr/bin/burncdaudio.sh
Make this file executable
#chmod +x /usr/bin/burncdaudio.sh
Now edit the file library.xml in /usr/share/mythtv and add these lines. (Remember to make a backup of this before you edit it just in case things go astray, as with any edited file). This could also be put in the optical_menu.xml file, but again put it where you feel fit.
<button>
<type>Audio CD Creation</type>
<text>Burn Audio CD</text>
<action>EXEC sh /usr/bin/burncdaudio.sh</action>
</button>
Now you'll want to check that the script runs without errors, so as the mythtv user in a console window run the frontend.
$mythfrontend
Go to media library --> listen to music, press '3' key to edit playlist, select 2 or 3 songs and then exit out. Now you should have the songs you selected in your default playlist. This is where the script will get the songs from. (A quick note: While in the 'Edit Playlist' window if you highlight the 'Active Play Queue' selection and press 'm' you'll be able to see how much time your using.) Exit out of the frontend. As the mythtv user do this
$sh /usr/bin/burncdaudio.sh
If the script finishes without error then your good to go select more songs and run the script form the button you created earlier. You won't be able to do anything else until the disc is done. (kinda like the backup and restore scripts from the knoppmyth menu)
If you get errors with the burning process (as I did). Then to solve this you'll need to create a file called cdrdao.conf. Now using your favorite editor create this file and add this line.
write_driver: "generic-mmc-raw"
as root copy this new file to /etc
$su
password
#cp cdrdao.conf /etc/cdrdao.conf
Now run the script again to make sure it'll create your disc.
If you want you can add these two lines into the burncdaudio script so that sounds are played to indicate the start and finish of the script just like the knoppmyth backup and restore scripts do.
under this line "PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games"
export PATH"
add
# So we know the script has started we will play a sound.
(play /usr/share/sounds/beg.wav >& /dev/null)&
under this line "rm -fr /myth/cdaudio/tmp" add
# So we know the script has ended we will play a sound.
(play /usr/share/sounds/end.wav >& /dev/null)&
You should be good to go
Good Luck