[icecast] how to cut very big mp3s ?

Xavier Montero xmontero at dsitelecom.com
Mon Jan 7 21:39:07 UTC 2002

> > so chopping the file would require quite a lot of
> > reorganization.

> My experience is to the contrary: cutting mp3 files with a simple tools
> like dd works OK. Just calculate the amount you want to cut (128 kb/s =

The reason is that the former way (ie: Cutting on frame boundaries)
is the "correct" way, as it is true that frames are non divisible.

But the latter case, simply "trashes" one frame and the file seems
to sound because the decoder cannot decode and remains untriggered
until it finds the next frame boundary.

This makes the file "appear" sounding well, although we have lost
data: we have lost exactly the frame being cut.

For example, suppose you generate a sine wave. Suppose you generate
exactly one second of a 1KHz, and you generate exactly 1000 complete
cycles. Then try to cut the file just in 4 exact blocks (supposedly
250 cycles at each) then swap blocks 2 and 3 and reintegrate the file,
ie: Cycles change supposedly from




Then play the file. You'll hear a glitch exactly at 0.25, 0.5
and 0.75 seconds.

So, both techniques are correct, but one (the "brutus" one) is
destructive while the former one is not. Anyway, if you cut
on frame boundaries you'll also hear glitches because phase
of frames need not to match the phase of the incoming wave,
so in the order alteration, perhaps we match two waves with
a phase disruption.

Anyway, It more depends on a "politeness" practice, as the
decoder may safely skip the "broken" frame and start playing
the next, but a decoder could also get lost and try to recover
with a much longer latency (for example a player could say,
"if I get lost, I'll unmute when I know for sure that I'm
on the correct place and that will be assumed after 25
decoded frames with no disruption").

See ya!

--- >8 ----
List archives:  http://www.xiph.org/archives/
icecast project homepage: http://www.icecast.org/
To unsubscribe from this list, send a message to 'icecast-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Icecast mailing list