Skip to content

Instantly share code, notes, and snippets.

@Tam
Last active October 30, 2021 20:02
Show Gist options
  • Save Tam/406383e9617eb60b19343608ed934803 to your computer and use it in GitHub Desktop.
Save Tam/406383e9617eb60b19343608ed934803 to your computer and use it in GitHub Desktop.
Convert .m4a files that don't work with Spotify to ones that do
#!/bin/bash
for filename in *.m4a
do ffmpeg -i "$filename" -acodec copy -movflags faststart "s-$filename"
done

How to use (macOS)

  1. $ brew install ffmpeg --with-fdk-aac --with-tools --with-freetype --with-libass --with-libvorbis --with-libvpx --with-x265
    a. You probably will only need the --with-fdk-aac flag, but I'm not sure.
  2. $ cd into the directory with the files you want to fix.
  3. Place the fix_m4a file into that directory (remove the .sh file extension)
  4. $ chmod 700 fix_m4a to allow you to run it
  5. $ ./fix_m4a This will fix all the .m4a files, creating fixed versions prefixed with s-.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment