From: Bastian Dehn Date: Fri, 25 Sep 2026 17:40:28 +0000 (+0200) Subject: add encode vorbis X-Git-Tag: v1.0.0^2~7^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=ed87c138a93ac01c1862c5d9ffc0c0258f951658;p=albentohandy.git add encode vorbis --- diff --git a/src/lib/vorbis.sh b/src/lib/vorbis.sh index 4a99d5d..99446a8 100644 --- a/src/lib/vorbis.sh +++ b/src/lib/vorbis.sh @@ -68,6 +68,38 @@ vorbis_cover_to_metadata() } > "$covermetadata" } +vorbis_encode_flac() +{ + local flac="$1" + local ogg=${flac/.flac/.ogg} + local path="${flac%/*}" + local covermetadata="$path/cover.txt" + QUALITY=${QUALITY:-"6"} + + nice --adjustment=10 flac \ + --totally-silent \ + --stdout \ + --decode \ + "$flac" \ + | nice --adjustment=15 oggenc \ + --quiet \ + --serial 1 \ + --quality "$QUALITY" \ + --output "$ogg" - + metaflac --export-tags-to=- \ + "$flac" \ + | vorbiscomment \ + --commentfile - \ + --write \ + "$ogg" + echo "METADATA_BLOCK_PICTURE=$(base64 --wrap 0 "$covermetadata")" \ + | vorbiscomment \ + --commentfile - \ + --raw \ + --append \ + "$ogg" +} + vorbis_encode() { local work_path="$1" @@ -75,6 +107,13 @@ vorbis_encode() | sort \ | parallel --will-cite --ungroup \ vorbis_cover_to_metadata {} + find "$work_path" -name '*.flac' \ + | sort \ + | parallel --will-cite --ungroup --eta --progress \ + vorbis_encode_flac "{}" } -vorbis_check_programs || return $? \ No newline at end of file +vorbis_check_programs || return $? +export -f vorbis_write_number_to_byte +export -f vorbis_cover_to_metadata +export -f vorbis_encode_flac \ No newline at end of file