#!/bin/bash #---------------------------------------------------- # Version: 0.1.0 # Author: Florian "Bluewind" Pritz # # Licensed under WTFPL v2 # (see COPYING for full license text) # #---------------------------------------------------- # Converts a number of files provided on the command line to OGG #---------------------------------------------------- for i in "$@"; do pushd . &> /dev/null cd "$(dirname "$i")" file="$(basename "$i")" file_ogg="$(echo ${file} | sed 's/\(.*\)\..*/\1/').ogg" tmpfile="$(echo ${file} | sed 's/\(.*\)\..*/\1/').wav" mplayer -ao pcm:fast -novideo -vc null -vo null -ao pcm:file="$tmpfile" "$file" oggenc -q 5 "$tmpfile" rm "$tmpfile" popd &> /dev/null done