From: Bastian Dehn Date: Sun, 20 Jan 2019 11:50:34 +0000 (+0100) Subject: add: flac to vorbis script X-Git-Tag: v1.0.0^2~78^2~5 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=553c3f3ef49bb537109132f751d71b731daa6b49;p=albentohandy.git add: flac to vorbis script --- diff --git a/flactovorbis b/flactovorbis new file mode 100755 index 0000000..21c5319 --- /dev/null +++ b/flactovorbis @@ -0,0 +1,32 @@ +#!/bin/bash + +ReadFlacToOggTags() +{ + local readonly INPUTFILE="$1" + local readonly OUTPUFILE="$2" + + metaflac --export-tags-to=- $INPUTFILE \ + | vorbiscomment -c - -w $OUTPUTFILE +} + +EncodingFlacToOgg() +{ + local readonly INPUTFILE="$1" + local readonly OUTPUTFILE="$2" + + # stream flac into the ogg vorbis + nice --adjustment=10 flac --silent --stdout --decode "$INPUTFILE" \ + | nice --adjustment=15 oggenc -q 6 -o "$OUTPUTFILE" - +} + +main() +{ + local readonly INPUTFILE="$1" + local readonly OUTPUTFILE="${INPUTFILE[@]/%flac/ogg}" + + EncodingFlacToOgg "$INPUTFILE" "$OUTPUTFILE" + ReadFlacToOggTags "$INPUTFILE" "$OUTPUTFILE" +} + +main "$1" +exit 0