24 lines
505 B
Bash
Executable File
24 lines
505 B
Bash
Executable File
#!/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
|