#!/usr/bin/env bash

# Converts .mp3 and .wav samples to ogg
find samples \( -iname '*.wav' -o -iname '*.mp3' -o -iname '*.flac' \) -exec sh -c 'ffmpeg -i "$1" -codec:a libopus -ac 1 "${1%.*}.ogg"' find-sh {} \; -exec rm {} \;

#!/usr/bin/env bash

cd "${0%/*}"

# Converts .mp3 and .wav samples to ogg
find samples \( -iname '*.wav' -o -iname '*.mp3' -o -iname '*.flac' \) -exec sh -c 'ffmpeg -i "$1" -codec:a libopus -ac 1 "${1%.*}.ogg"' find-sh {} \; -exec rm {} \;

Change directory before converting samples
Change directory before converting samples

Allows running the conversion script from an arbitrary location
