#!/bin/bash # # convert-all-songs - Batch convert all mp3 files in current directory to m4a format # # Converts all .mp3 files in the current directory to .m4a (AAC) format at 128 kbps. # Removes any existing .m4a files before conversion to avoid conflicts. # # Usage: convert-all-songs # # Requirements: ffmpeg, convert-song script in same directory set -euo pipefail for file in *.mp3; do echo "* Converting $file to ${file%.mp3}.m4a..." rm -f "${file%.mp3}.m4a" "${BASH_SOURCE[0]}/../convert-song" "$file" >/dev/null 2>&1 done