flac2mp3.xsl
1.22 KB
<?xml version="1.0" encoding="ISO-8859-15"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="no" encoding="ISO-8859-15" />
<xsl:template match="/">
outdir="../../../mp3/<xsl:value-of select="/cdinfo/cd-artist"/>"
outdir="$outdir/<xsl:value-of select="/cdinfo/cd-title"/>"
mkdirhier "$outdir"
<xsl:apply-templates select="/cdinfo/track"/>
</xsl:template>
<xsl:template match="track">
tracknum=`echo <xsl:value-of select="track-number"/> | \
awk '{printf("%02d", $0)}'`
title="<xsl:value-of select="track-title"/>"
flac -d -o - "$tracknum-$title.flac" | \
lame -h --ta "<xsl:value-of select="track-artist"/>" \
--tl "<xsl:value-of select="/cdinfo/cd-title"/>" \
--tg "<xsl:value-of select="/cdinfo/cd-genre"/>" \
--tt "<xsl:value-of select="track-title"/>" \
--tn "<xsl:value-of select="track-number"/>" \
--ty "<xsl:value-of select="/cdinfo/cd-year"/>" \
--tc "<xsl:value-of select="track-comment"/>" - \
"$outdir/$tracknum-$title.mp3"
</xsl:template>
</xsl:stylesheet>