Image 01
profile-image

Grunty

Dan Searle
Transcogg

Amarok 1.x Scripts by zezinho 16 comments

Thanks, for adding my patch:) - Jan 04 2008
Transcogg

Amarok 1.x Scripts by zezinho 16 comments

I have added flac input support to the script. Heres a diff, take it or leave it...

--- 63121-transcogg 2007-08-09 14:00:27.000000000 +0100
+++ transcogg 2007-12-25 23:25:16.000000000 +0000
@@ -83,6 +83,17 @@ ogg2ogg()
rm $tmpfile
}

+flac2ogg()
+{
+ out=$1
+ in=`uri_to_file "$2"`
+ tmpfile='/tmp/flac2ogg'
+ flac -d --silent --stdout "$in" | oggenc -q 0 -Q -r -o "$out" - 2>&1
+ metaflac --list "$in" | grep comment | grep -v -e "^.*comments: [0-99]" | sed 's/^.*\[[0-99]\]: //g' > $tmpfile
+ vorbiscomment -w -c "$tmpfile" "$out"
+ rm $tmpfile
+}
+
get_decoder()
{
uri=`uri_to_file $1`
@@ -90,6 +101,7 @@ get_decoder()
case $format in
audio/mpeg) echo mp32ogg;;
application/ogg) echo ogg2ogg;;
+ audio/x-flac) echo flac2ogg;;
*) error $uri "Unsupported format \"$format\""
return 1;;
esac
@@ -130,6 +142,8 @@ transcode()
outfile='/tmp/transcogg.ogg'
if [ $decoder = "mp32ogg" ]; then
error=`mp32ogg --quality=0 --rename="$outfile" "$file" 2>&1`
+ elif [ $decoder = "flac2ogg" ]; then
+ error=`flac2ogg "$outfile" "$file" 2>&1`
else
error=`ogg2ogg "$outfile" "$file" 2>&1`
fi

- Dec 25 2007