diff --git a/.local/bin/oggconv b/.local/bin/oggconv new file mode 100755 index 0000000..56f74fc --- /dev/null +++ b/.local/bin/oggconv @@ -0,0 +1,23 @@ +#!/usr/bin/env sh + +# Author: Simon Legner + +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