Skip to content

Instantly share code, notes, and snippets.

@mmenavas
Last active August 26, 2024 00:13
Show Gist options
  • Save mmenavas/cc68800243d6d8f6732ce2725ac47292 to your computer and use it in GitHub Desktop.
Save mmenavas/cc68800243d6d8f6732ce2725ac47292 to your computer and use it in GitHub Desktop.
Convert m4a files to mp3
#!/bin/bash
# Create "input" and "output" directories. Place m4a files in "input" directory. Run `bash m4a2mp3` and the new mp3 files will be stored in "output".
cd ./input
for filename in ./*; do
tmp="${filename/.m4a/}";
echo Converting: "$tmp";
ffmpeg -v 5 -y -i "$filename" -acodec libmp3lame -ac 2 -ab 128k ../output/"$tmp".mp3;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment