#!/bin/sh
#Convert mp3 to wav from any rate

file=$1
rate=`mp3info -f '%F' "$file"`
mpg123 -r 44100 -s "$file" | sox -V -t raw -r $rate -w -s -c 2 - -r 44100 -t wav -w -c 2 "${file%mp3}wav"
