} > "$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"
| 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