Skip to content

Instantly share code, notes, and snippets.

@luizen
Created May 14, 2025 15:48
Show Gist options
  • Save luizen/4faaea7f12c8402106b2abab96ba1b31 to your computer and use it in GitHub Desktop.
Save luizen/4faaea7f12c8402106b2abab96ba1b31 to your computer and use it in GitHub Desktop.

AIFF to MP3

This is an iTerm2 snippet that uses ffmpeg to convert all AIFF files in a given folder to their corresponding MP3s

Dependencies

  • ffmpeg

Config

C-Style Backslash Escaping

Snippet content

OIFS="$IFS"
IFS=$'\n'
for file in $(find $PWD -type f -name "*.aiff"); do /<fully-qualified-base-path-for-ffmpeg-binary>/ffmpeg -i "${file}" -f mp3 -acodec libmp3lame -ab 320k -ar 44100 -y "${file%.aiff}.mp3"; done
IFS="$OIFS"

💡 Replace <fully-qualified-base-path-for-ffmpeg-binary> by the actual path where the ffmpeg binary is located.

How to run

In iTerm2:

  1. cd into the folder containing the AIFF files
  2. Run the snippet
  3. Wait for the conversions to finish
  4. Done

The resulting MP3 files will be put together with their original AIFF corresponding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment