Skip to content

Instantly share code, notes, and snippets.

@vol4ok
Created May 3, 2012 18:21
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save vol4ok/2587886 to your computer and use it in GitHub Desktop.
Save vol4ok/2587886 to your computer and use it in GitHub Desktop.
Split .ape and .flac and convert to .m4a (ALAC) or .mp3 on MacOS X
brew install flac ffmpeg cuetools # ставим нужные пакеты
# скачиваем cuetag.sh скрипт, например отсюда https://github.com/gumayunov/split-cue/blob/master/cuetag
ffmpeg -i 1.ape 1.flac # конвертируем во flac, так как libmac для APE не ставится на osx
cuebreakpoints 1.cue | shnsplit -o flac 1.flac #нарезаем на треки
cuetag 1.cue split-track*.flac #прописываем тэги (cuetag.sh ставится отдельно отдельно)
#конвертируем в ALAC
for f in split-track*.flac
do
ffmpeg -i "$f" -acodec alac "${f%.flac}.m4a";
done
#если надо то MP3, то конвертируем так
for f in split-track*.flac
do
ffmpeg -i $f -ab 320k -ac 2 -ar 48000 ${f%.*}.mp3
done
@jayna37
Copy link

jayna37 commented Sep 18, 2015

^ Blatant advertisement (the comment from muchbetterbig)

@Derrior
Copy link

Derrior commented Dec 15, 2016

One more dependency: shntool for shnsplit

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