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