Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Split a mp3 file ("MALEFACTOR - Sixth Legion") on macOS
#!/usr/bin/env bash
# Split a mp3 file ("MALEFACTOR - Sixth Legion") on macOS
##
# Install ffmpeg (macOS)
#
# $ brew install ffmpeg
# $ brew link ffmpeg
##
# Put the mp3 in the folder that will run the script
# Example: MALEFACTOR - Sixth Legion - Album 2017 Full.mp3
#
##
# Album & info tracks:
# https://www.youtube.com/watch?v=HtF0z0tikZ4
# Download audio with:
# http://www.flvto.biz/pt/
#
### REPLACE WITH "_" THE SPACES
# invalid: "MALEFACTOR - Sixth Legion - Album 2017 Full.mp3"
# corrent: "MALEFACTOR_-_Sixth_Legion_-_Album_2017_Full.mp3"
#
file_to_split="${HOME}/Downloads/MALEFACTOR_-_Sixth_Legion_-_Album_2017_Full.mp3"
### I put the file on "Downloads"
## Run this script
# $ bash split.sh
# 00:00 Counting The Corpses
ffmpeg -i ${file_to_split} -acodec copy -ss 00:00:00 -to 00:05:31 track1.mp3
sleep .2
# 05:31 Stygia
ffmpeg -i ${file_to_split} -acodec copy -ss 00:05:31 -to 00:12:27 track2.mp3
sleep .2
# 12:27 They Speak My Name in Tongues
ffmpeg -i ${file_to_split} -acodec copy -ss 00:12:27 -to 00:17:45 track3.mp3
sleep .2
# 17:45 The Styx River
ffmpeg -i ${file_to_split} -acodec copy -ss 00:17:45 -to 00:22:33 track4.mp3
sleep .2
# 22:33 Behold the Evil
ffmpeg -i ${file_to_split} -acodec copy -ss 00:22:33 -to 00:28:22 track5.mp3
sleep .2
# 28:22 Sodom and Gomorrah
ffmpeg -i ${file_to_split} -acodec copy -ss 00:28:22 -to 00:33:22 track6.mp3
sleep .2
# 33:22 Down at the Valley of the Great Encounter
ffmpeg -i ${file_to_split} -acodec copy -ss 00:33:22 -to 00:40:36 track7.mp3
sleep .2
# 40:36 The Humanist
ffmpeg -i ${file_to_split} -acodec copy -ss 00:40:36 -to 00:46:08 track8.mp3
sleep .2
# 46:08 Cross and Fiction
ffmpeg -i ${file_to_split} -acodec copy -ss 00:46:08 -to 00:51:48 track9.mp3
sleep .2
# 51:48 Borgia
ffmpeg -i ${file_to_split} -acodec copy -ss 00:51:48 -to 00:56:46 track10.mp3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment