#!/bin/sh # Converts anything mplayer can play to mp3 # Usage: any2mp3 infile outfile # Command line arguments INFILE="$1" OUTFILE="$2" # Lame options QUALITY="cd" MORE_LAME_ARGS="-q 2" pipe=/tmp/mp3pipe.$$ # Set up fifo rm -f $pipe mkfifo $pipe # Do the conversion mplayer -novideo -vc null -vo null -really-quiet -ao pcm:file=$pipe "$INFILE" > /dev/null & nice -+1 lame -S --preset $QUALITY $MORE_LAME_ARGS $pipe "$OUTFILE" # Clean up rm -f $PIPE