cut and join mp3-files with known bitrate

S

Susanne Kaufmann

Hello,

what would be the easiest way to cut and join files?

I want to do this with 2 mp3-files. I do not have to decode them,
because I know exactly their bitrate/frame size, so it should be easy
to cut.

What I want is e.g. to join the last minute of file 1 with the first
minute of file 2 and create a new file.

Thank you in advance,

regards,

Susanne
 
O

Oliver Wong

Susanne Kaufmann said:
Hello,

what would be the easiest way to cut and join files?

I want to do this with 2 mp3-files. I do not have to decode them,
because I know exactly their bitrate/frame size, so it should be easy
to cut.

What I want is e.g. to join the last minute of file 1 with the first
minute of file 2 and create a new file.

They might have ID3v2 tags which, if I understand correctly, appear at
the head of the file, and are of variable length. So you might have to do at
least some minimal decoding.

- Oliver
 
O

Oliver Wong

Susanne Kaufmann said:
I create the soundfiles by myself without any header.

See http://mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm

While a "frame size" is constant, the frame size is the number of
samples within a frame, not its size in bytes. The encoding of the samples
varies from frame to frame to ensure a constant bit rate. 128kbps 44.1Khz
layer II uses mostly 418 byte frames, but occasionally will use a 417 byte
frame.

You can cut a mp3 file at any frame boundary, but I'm not sure you can,
for an arbitrary mp3 file, determine what byte offset to jump to to arrive
at exactly the "1 minute" point. You may have to decode, at the very least,
calculate how many samples are in 1 minute, and then jump through the file
looking for frame-synchronization markers.

- Oliver
 
G

Gordon Beaton

what would be the easiest way to cut and join files?

I want to do this with 2 mp3-files. I do not have to decode them,
because I know exactly their bitrate/frame size, so it should be easy
to cut.

What I want is e.g. to join the last minute of file 1 with the first
minute of file 2 and create a new file.

I don't know a lot about mp3 encoding, but you might find it
worthwhile (or discouraging) to read the LAME tech-FAQ, in particular
question 4 describing why MP3 files can't be seamlessly spliced
together (not easily anyway).

http://lame.sourceforge.net/tech-FAQ.txt

/gordon
 
A

Andrew T.

Gordon said:
....
...you might find it
worthwhile (or discouraging) to read the LAME tech-FAQ, in particular
question 4 describing why MP3 files can't be seamlessly spliced
together (not easily anyway).

(Susanne - earlier)
..I create the soundfiles by myself ...

Given you are creating the sound files, it may be best
to create them in a more controllable/editable format.
Have you investigated using PCM encoding?

Andrew T.
 
C

Chris Uppal

Andrew said:
(Susanne - earlier)

Given you are creating the sound files, it may be best
to create them in a more controllable/editable format.
Have you investigated using PCM encoding?

Especially as it's always a good idea to postpone any use of lossy compression
until after all editing is complete.

-- chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top