conversion .mp3 <->.wav<->.ogg
dan
hentaidan at gmail.com
Fri Jun 24 14:58:09 UTC 2005
On 24/06/05, vern <vern at riseup.net> wrote:
> Hi
> is there a simple tool that does this conversion...??
> []'s
> Ian
>
I'm not too sure where I got this from but I think it works:
#!/bin/bash
if [ ! -f "$1" ]; then
echo "Usage: $(basename $0) <file.mp3> [Album name]"
exit 1
fi
IN_FILE="$1"
OUT_FILE="${IN_FILE%%.mp3}".ogg
TOC_FILE="${IN_FILE%%.mp3}".toc
mkfifo soundpipe
oggenc -b 192 soundpipe -o "$OUT_FILE" > /dev/null 1>&2 &
mplayer -quiet -ao pcm -aofile soundpipe -vo null -vc dummy "$IN_FILE"
2> /dev/null | grep -e author -e name > "$TOC_FILE"
rm -f soundpipe
TITLE=$(cat "$TOC_FILE" | grep " name:" | sed -e 's/ name: //g')
ARTIST=$(cat "$TOC_FILE" | grep " author:" | sed -e 's/ author: //g')
ALBUM=""
[ -n "$2" ] && ALBUM="$2"
vorbiscomment -a -t "ARTIST=$ARTIST" -t "TITLE=$TITLE" -t
"ALBUM=$ALBUM" "$OUT_FILE"
rm -f "$TOC_FILE"
Put it in your Nautilus scripts folder, make it executable, and then
you can right click on your mp3 and select the script from the context
menu.
Dan
--
http://www.danicity.co.uk
chaz_249 at hotmail.com
http://www.nosoftwarepatents.com/
More information about the ubuntu-users
mailing list