#!/bin/sh set -e tmp=/tmp/tmp.wav for x in "$@"; do mplayer -vc null -vo null -ao pcm:fast:waveheader:file="$tmp" "$x" lame "$tmp" "${x%.*}.mp3" done rm "$tmp"