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 &quot;$outdir&quot;
      <xsl:apply-templates select="/cdinfo/track"/>
   </xsl:template>

   <xsl:template match="track">
tracknum=`echo <xsl:value-of select="track-number"/> | \
   awk &apos;{printf(&quot;%02d&quot;, $0)}&apos;`
title=&quot;<xsl:value-of select="track-title"/>&quot;
flac -d -o - &quot;$tracknum-$title.flac&quot; | \
   lame -h --ta &quot;<xsl:value-of select="track-artist"/>&quot; \
        --tl &quot;<xsl:value-of select="/cdinfo/cd-title"/>&quot; \
        --tg &quot;<xsl:value-of select="/cdinfo/cd-genre"/>&quot; \
        --tt &quot;<xsl:value-of select="track-title"/>&quot; \
        --tn &quot;<xsl:value-of select="track-number"/>&quot; \
        --ty &quot;<xsl:value-of select="/cdinfo/cd-year"/>&quot; \
        --tc &quot;<xsl:value-of select="track-comment"/>&quot; - \
        &quot;$outdir/$tracknum-$title.mp3&quot;
   </xsl:template>
</xsl:stylesheet>