Several of my music albums are one file. Mainly flac files. I ve been trying to find a way to split an album into it s individual songs. After trying several gui apps with limmited success I discovered sox; a cli app . It uses the silence gap between each song as a starting/ending point, and it s very fast. It will split an album file in seconds. The command is as simple as this:
for i in *.flac; do sox $i $i -V3 silence 1 0.1 1% 1 1.0 1% : newfile : restart; done
My guess is it uses the for loop iteration and appends it to the original file name which is how the resulting files are named, (filename001, filename002âŠ), so renaming is required after splitting. It doesn t like spaces in the file name, and in my case, it always makes an extra split as the last file which is a few kb in size. Other than that it works great. I was thinking of searching for a way to do the same thing with ffmpeg, but I found this app first. The good thing about it all is it s in the Arch repository.
I was going to start a thread about Has Anyone Tried Flacon?
I have albums on a single mp3 and concerts on a singe mp4âŠhow do these programs work? detect the lull then seperate etc? Or lotta manual intervention required?
Look forward to more replies on this.
ah so it does kinda sniff for a lullâŠwonder if it can do concerts as well. thanks for the tip. will experiment.
I can t imagine a program that could do it, but if it could listen for only a cheering crowd, and use that as a gap, instead of silence, then a concert seem feasible. I do know the length of silence setting can be tweaked, but not sure about the resolution of noise, or the ability to single out specific noise. There is probably an ai app that can do it.
Edit: Hahaha. As soon as I thought that I looked it up.
You know what would be interesting is if you could remove/split out the audience in a live album.
You were right asking exactly this! Iâve been using Flacon for ever and a while to cut FLAC âwhole discâ RIPs (i.e., live), works great. You do need the correct .cue file, though. No problem if you ripped it yourself.
N.B.: Using silence detection can horribly fail, depending on the type of music. Learned that the hard way when writing Autocue to automatically cue songs for broadcasting, much like a Radio DJ would.
A cue file basically tells where on the CD (or in the programme) which title plays/played, and contains title and performer info. Programs like whipper ode (on Windoze) EAC can generate such a file when ripping. It looks like so (this one taken from a 2019 broadcast, not from a CD):
TITLE "Velvet Viper Special (Wdh. v. 01.11.2019)"
PERFORMER "PapaBear"
FILE "aufzeichnung.2019-11-01.200024.mp3" MP3
TRACK 01 AUDIO
TITLE "FOX Sports Theme"
PERFORMER "Opener"
INDEX 01 00:00:00
TRACK 02 AUDIO
TITLE "Confuse and Satisfy"
PERFORMER "Velvet Viper"
REM ALBUM "The Pale Man Is Holding A Broken Heart"
INDEX 01 01:33:23
TRACK 03 AUDIO
TITLE "Rebirth by Fire"
PERFORMER "Zodiac"
REM ALBUM "Grain of Soul"
INDEX 01 07:32:72
TRACK 04 AUDIO
TITLE "Build Me Up, Break Me Down"
PERFORMER "Dream Theater"
REM ALBUM "A Dramatic Turn of Events"
INDEX 01 10:53:16
TRACK 05 AUDIO
TITLE "The Pale Man"
PERFORMER "Zed Yago"
REM ALBUM "Pilgrimage"
INDEX 01 18:37:37
TRACK 06 AUDIO
TITLE "Teil 1"
PERFORMER "Interview"
INDEX 01 23:30:67
TRACK 07 AUDIO
TITLE "Samson and Delilah"
PERFORMER "Velvet Viper"
REM ALBUM "The Pale Man Is Holding A Broken Heart"
INDEX 01 27:09:00
TRACK 08 AUDIO
TITLE "Father Time"
PERFORMER "Oliva"
REM ALBUM "Raise the Curtain"
INDEX 01 33:00:60
TRACK 09 AUDIO
TITLE "Out of Control"
PERFORMER "Mother Jane"
REM ALBUM "Turn the Page"
INDEX 01 38:09:06
TRACK 10 AUDIO
TITLE "Teil 2"
PERFORMER "Interview"
INDEX 01 42:54:42
TRACK 11 AUDIO
TITLE "Keep Your Head Up"
PERFORMER "Velvet Viper"
REM ALBUM "The Pale Man Is Holding A Broken Heart"
INDEX 01 47:47:70
TRACK 12 AUDIO
TITLE "Sharp Dressed Man"
PERFORMER "ZZ Top"
REM ALBUM "Eliminator"
INDEX 01 52:41:04
TRACK 13 AUDIO
TITLE "Das kann man ja auch mal so sehen"
PERFORMER "Jutta Weinhold"
REM ALBUM "Icebreaker - Best of"
INDEX 01 57:26:04
TRACK 14 AUDIO
TITLE "On With the Show"
PERFORMER "Y & T"
REM ALBUM "Facemelter"
INDEX 01 63:48:47
TRACK 15 AUDIO
TITLE "Teil 3"
PERFORMER "Interview"
INDEX 01 67:56:69
TRACK 16 AUDIO
TITLE "The Wheel Has Come Full Circle"
PERFORMER "Velvet Viper"
REM ALBUM "The Pale Man Is Holding A Broken Heart"
INDEX 01 72:22:28
TRACK 17 AUDIO
TITLE "MĂ€dchen"
PERFORMER "Jutta Weinhold"
REM ALBUM "Icebreaker - Best of"
INDEX 01 78:16:52
TRACK 18 AUDIO
TITLE "Chicks = Trouble"
PERFORMER "Mötley CrĂŒe"
REM ALBUM "Saints of Los Angeles"
INDEX 01 82:44:66
TRACK 19 AUDIO
TITLE "Teil 4"
PERFORMER "Interview"
INDEX 01 85:59:27
TRACK 20 AUDIO
TITLE "Something Is Rotten"
PERFORMER "Velvet Viper"
REM ALBUM "The Pale Man Is Holding A Broken Heart"
INDEX 01 90:31:50
TRACK 21 AUDIO
TITLE "Ghost"
PERFORMER "Slash feat. Ian Astbury"
REM ALBUM "Slash"
INDEX 01 96:19:06
TRACK 22 AUDIO
TITLE "Still of the Night"
PERFORMER "Whitesnake"
REM ALBUM "30th Anniversary Collection"
INDEX 01 100:36:39
TRACK 23 AUDIO
TITLE "Respice Finem"
PERFORMER "Velvet Viper"
REM ALBUM "Respice Finem"
INDEX 01 107:39:62
TRACK 24 AUDIO
TITLE "Thanks for the Night"
PERFORMER "Big Daddy Wilson & Doc Fozz"
REM ALBUM "...doin' it right"
INDEX 01 118:57:28
This works good even with classical music and live CDs, since it can handle CD track and index information. Which, in turn, Flacon can pick up and do exact cuts.
Later on, if you have a player that can do âgapless playingâ (like Lyrion), you can even listen to a complete album again without any interruptions when the track file changes.
Note you should use FLAC (or WAV) as source material. Cutting MP3s in an inexact thing due to its nature. (But still possible.)
thanks for that explanation and demo. I get it better as far as this file. Sounds like a master file you have to keep. Hopefully you donât have to treat it like a config file.
âA Pale Man is Holding a Broken Heartâ is a hell of a title, but I get distracted easy and my mind keeps replacing the word âmanâ with âmoonâ it fits better to me.
Thereâs an easy rule: If you keep the full-length file (CD, concert, broadcast, âŠ), also keep the .cue file. Because some programs can actually also play directly from the big file + a cue file. Lyrion can, and I believe mpd and beets also, maybe more.
If you only keep the cut single tracks, you donât need to keep the .cue file. I normally do that, because I use FLAC anyway, and we have gapless playback, so all good.
Btw, sox is of course also a great tool for many things. I use that (with a little script) to quickly produce simple jingles for radio shows.
I appreciate you experience in this matter. In my case sox worked perfectly for me. Maybe it was the fact that, in my case, I was working with studio albums, and there were definite silence gaps. You have intrigued me though. I will be researching Flacon now
You can of course also listen to it (or use Audacity to get timings) and write your own .cue fileâitâs just a text file after all. I actually did that for a live recording once, where we of course had no cue file.
just went back and listened to it. Itâs about 1/10th of a second if I had to guess. Probably much less. itâs a pause but oh-so-tiny. Donât know if Sox would detect it.
U2âback when they were good in the 80âsâdid this with An Cat Dubh and Into the Heart but they bled both songs into each other so it would be undetectable.
But I digress.
Then again, itâs nice to read a little digression by music lovers! Life is not only about ricing your install⊠seeing people use their systems to make life more enjoyable just feels⊠right.