<rdf:RDF
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xml:base='http://community.moertel.com/ss/rdf'>
    <s:Snip rdf:about='http://community.moertel.com/ss/rdf#2004-03-20'
         s:name='2004-03-20'
         s:cUser='tmoertel'
         s:oUser='tmoertel'
         s:mUser='tmoertel'>
        <s:content>1 The Road Trip and Burning Speex files to audio CDs {anchor:The Road Trip and Burning Speex files to audio CDs}&#xA;Today, I&apos;m going on a road trip, and I would like to listen to&#xA;something interesting while driving.  In an earlier post,&#xA;[2004-02-20#My_new_Radio_VCR], I described a &quot;VCR&quot; that I created to&#xA;record radio shows.  Why not listen to some of the recorded shows&#xA;while on the road?&#xA;&#xA;The Radio VCR saves the shows in Speex format, but my car&apos;s audio&#xA;system, like most, can handle only plain-old audio CDs.  Thus I needed&#xA;to burn a few CDs from my {link:Speex|http://www.speex.org} files.&#xA;It&apos;s a three step process:&#xA;&#xA;1. Decode Speex format into raw, 16 kHz audio.&#xA;1. &quot;Upsample&quot; the 16 kHz audio into CD-ready 44.1 kHz audio.&#xA;1. Burn the 44.1 kHz audio to a CD.&#xA;&#xA;It sounds simple, and it is &amp;#8211; once you figure out all&#xA;the proper speexdec, sox, and cdrecord settings.  To save&#xA;you the trouble, here&apos;s the script I wrote to automate the&#xA;process:&#xA;&#xA;{code:none}&#xA;\#!/bin/bash&#xA;\#&#xA;\# $Id: burn-speex,v 1.3 2004/03/20 15:58:02 thor Exp $&#xA;\# TGM 2004-03-20&#xA;\#&#xA;\# Usage: burn-speex file.spx&#xA;&#xA;&#xA;\# configuration&#xA;&#xA;cddevice=3,0,0&#xA;speed=8&#xA;&#xA;\# parse arguments&#xA;&#xA;file=&quot;$1&quot;&#xA;shift&#xA;&#xA;\# preflight checks&#xA;&#xA;[ -z &quot;$file&quot; ]   &amp;amp;&amp;amp; { echo &quot;Usage: burn-speex input.spx&quot;;  exit 1; }&#xA;[ -f &quot;$file&quot; ]   || { echo &quot;No such file: $file&quot;; exit 2; }&#xA;[ $(id -u) = 0 ] || { echo &apos;You must be root to burn a CD.  (Use sudo?)&apos;;&#xA;                      exit 3; }&#xA;&#xA;\# create temp file to hold WAV file&#xA;&#xA;tmp=$(mktemp \/tmp\/burn\-speex\-\XX\XX\XX)&#xA;mv &quot;$tmp&quot; &quot;$tmp.wav&quot;&#xA;tmp=&quot;$tmp.wav&quot;&#xA;&#xA;\# make sure the temp file is cleaned up&#xA;&#xA;cleanup() { rm -f &quot;$tmp&quot;; }&#xA;trap cleanup 1 2 3 5 13 15&#xA;&#xA;\# transcode the speex file into 44.1 kHz WAV file&#xA;&#xA;echo&#xA;echo &quot;Transcoding speex file $file into 44.1 kHz WAV format...&quot;&#xA;echo&#xA;speexdec --stereo &quot;$file&quot; - |&#xA;  sox -t raw -r 16000 -c 2 -sw - -r 44100 -t wav - resample &gt; &quot;$tmp&quot;&#xA;&#xA;\# burn the WAV file&#xA;&#xA;echo&#xA;echo &quot;Burning CD...&quot;&#xA;echo&#xA;cdrecord -v -pad -audio -eject speed=$speed dev=$cddevice &quot;$tmp&quot;&#xA;&#xA;\# clean up and exit&#xA;&#xA;cleanup&#xA;&#xA;echo&#xA;echo Done.&#xA;&#xA;exit 0&#xA;{code}&#xA;</s:content>
        <s:mTime>2004-04-22 03:00:48.172</s:mTime>
        <s:cTime>2004-03-20 11:20:49.294</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='#tmoertel'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#space/2004-03-20'/>
                <rdf:li rdf:resource='http://community.moertel.com/ss/rdf#'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
