[scripts] feat: convert audio files to ogg

This commit is contained in:
David JULIEN 2022-11-10 21:15:10 +01:00
parent fff5fa4456
commit 618f657d4b

23
.local/bin/oggconv Executable file
View File

@ -0,0 +1,23 @@
#!/usr/bin/env sh
# Author: Simon Legner <Simon.Legner@gmail.com>
convert () {
ffmpeg -i "$in" \
-acodec libvorbis -aq 6 -vn -ac 2 \
-map_metadata 0 \
"$out"
}
if [ "" = "$1" ]; then
echo Converts audio files to Ogg Vorbis using ffmpeg.
echo Usage: $0 file1.ext1 file2.ext2 ... fileN.ext4
echo ... produces file1.ogg file2.ogg ... fileN.ogg
fi
for i in "$@"; do
in="$1"
ext="$(basename "$in" | sed -e 's/.*\.//')"
out="${in%.$ext}.ogg"
convert
done