From 3379b3c58bf1551f76bd6d2978cda00128f6b5a0 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 22 Oct 2026 10:27:52 -0400 Subject: [PATCH] Add wav-to-mp3.sh --- convert-to-mp3.py | 2 +- wav-to-mp3.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 wav-to-mp3.sh diff --git a/convert-to-mp3.py b/convert-to-mp3.py index 3363b92..1cf70ba 100755 --- a/convert-to-mp3.py +++ b/convert-to-mp3.py @@ -6,7 +6,7 @@ import getopt from subprocess import * def main(argv): - bitrate = 128 + bitrate = 256 try: opts, args = getopt.getopt(argv[1:], "b:") except getopt.GetoptError: diff --git a/wav-to-mp3.sh b/wav-to-mp3.sh new file mode 100755 index 0000000..49f2e50 --- /dev/null +++ b/wav-to-mp3.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Loop through all .wav files in the current directory +for file in *.wav; do + # Skip if no .wav files exist (prevents literal "*.wav" execution) + [ -e "$file" ] || continue + + # Replace .wav extension with .mp3 + output="${file%.wav}.mp3" + + echo "Converting: $file -> $output" + lame -v -b 256 "$file" "$output" +done + +echo "Conversion complete!"