From dc18d3550a0fc39f259cec69b95f43b9cb0a3b48 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 1 May 2026 14:33:10 +0300 Subject: [PATCH] also quickly create flac-to-opus.bash --- bash/flac-to-opus.bash | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 bash/flac-to-opus.bash diff --git a/bash/flac-to-opus.bash b/bash/flac-to-opus.bash new file mode 100755 index 0000000..1a13c83 --- /dev/null +++ b/bash/flac-to-opus.bash @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -x + +# Pratcially more reasonable version of music-to-mp3.bash, but with more +# applicable/modern use-case than ancient mp3 players. + +# Without ffmpeg we are doomed to fail +if ! hash ffmpeg 2> /dev/null; then + echo "ffmpeg not found" + exit 1 +fi + +# Convert flacs +for flac in *.flac; do + if [ -f "$flac.opus" ]; then + echo "$flac.opus already exists" + else + ffmpeg -i "$flac" "$flac.opus" + fi +done + +# TODO: The output have silly extension .flac.opus + +set +x