Splitting MP3s (on Linux)?

Posted by: canuckInOR

Splitting MP3s (on Linux)? - 02/07/2002 21:10

Hi all,

Any recommendations on software (for Linux -- I don't have/want access to a Windows machine) that can split MP3 files into chunks without converting to WAV and back again? I have some tracks that I want to split up without re-ripping from CD -- hidden tracks within tracks, as well as some live sessions that I'd like to split into bits. The only two things I could find were Audacity, which appears to decode and re-encode, and split3pm, which looks a little dodgy given that the website says time resolution may be off by +/- 5 seconds!

Thanks for any suggestions...

Posted by: wfaulk

Re: Splitting MP3s (on Linux)? - 03/07/2002 03:37

You might be able to use gopchop, which is designed for MPEG2 video, but it might work for an audio-only stream as well. Then again, it might not.
Posted by: tfabris

Re: Splitting MP3s (on Linux)? - 03/07/2002 09:41

If you're into a bit of coding, the file format specification for MP3 frame headers is here. You could create a script or something to do it. The code isn't that tough, my GapKiller program just has a little routine to scan forward through a file finding each frame header, counting as it goes, and copying those frames to another file. I just change the copying process to go to a new file at a predetermined point (by number of frames). Since each frame in a 16-bit 44khz stereo file is always .02612 seconds long regardless of bitrate, I can pretty accurately determine the time index of the split.
Posted by: wfaulk

Re: Splitting MP3s (on Linux)? - 03/07/2002 09:53

Unfortunately, that simple process doesn't take into account the bit reservoir. While it's not likely to affect more than a fraction of a second's worth of audio, and is definitely better than reencoding, I just thought I'd point out that it's not a totally optimal solution.
Posted by: tfabris

Re: Splitting MP3s (on Linux)? - 03/07/2002 09:56

Right, splitting a file at the frame boundary does not take into account the bit reservior. However, when you actually do the splitting, you discover that there is, at worst, a few milliseconds of static at the split boundary due to the bit reservior. More often, it's not even an issue at all and it sounds fine.
Posted by: canuckInOR

Re: Splitting MP3s (on Linux)? - 03/07/2002 12:48

Thanks for the link, Tony. I was hoping to get away with no coding, but I'll check into it. The split3pm has source available, so with the info in the link, perhaps I'll have a go at making it work for what I need...

As for the millisecond or so of blip, I'm not too worried about that. My playlist usually consists of turning on random, and hitting down-down-down.
Posted by: Daria

Re: Splitting MP3s (on Linux)? - 09/07/2002 14:25

Try mpgcut from http://mpgcut.sourceforge.net/. It claims:

What it can do for you
mpgcut currently supports MPEG 1 video and MPEG 1/2/3 audio layers (i.e. mp1, mp2, mp3)


It also suggests looking at mpgtx
Posted by: grgcombs

Re: Splitting MP3s (on Linux)? - 09/07/2002 21:34

Is there an application to split for wavs? I've got a Rollins Band cd that's all one track in a flac ... converting back to wave is easy for me.

g
Posted by: canuckInOR

Re: Splitting MP3s (on Linux)? - 09/07/2002 21:40

Oh, thanks! I missed those in my search, I'll check them out.
Posted by: Daria

Re: Splitting MP3s (on Linux)? - 09/07/2002 22:31

Is there an application to split for wavs?

dd?

seriously, they're just a number of samples of some size (typically 16 bit) so just count off some number of samples (times 2 if it's stereo) and write a wav header on what you took. I'm sure there are tools, because it's so incredibly simple to do.
Posted by: grgcombs

Splitting Live Rollins Band CD (Turned On) - 10/07/2002 07:29

Write after I posted this I got off my butt and looked for one ... I found plenty but most were crippled. I came across gramofile (Linux & Windows). It like several others forced you to run a track auto-detect algorithm, which fails miserably on this live CD. The benefit about this app, however, is that you get to edit it's track text file, putting in your own split times and number of splits. No one else had an option to do this manually.

The unpleasantness was spending a number of hours in Neo's Wave Editor listening and pinpointing the exact split for 15 tracks (none are obvious). Sadly I'm not big on the Rollins Band (just his spoken word stuff), and my teeth were clenched during the whole session, now I've got a headache.

If any of you would like the track split file I have for this CD, let me know. Save yourself the time.

Greg