D
D
Dimazsever2015-06-04 17:14:57
Programming
Dimazsever, 2015-06-04 17:14:57

How to trim an mp3 file?

I read an article on Habré about the structure of an Mp3 file. The link to the article is in the comment, since they won’t let me leave it in the post again. Download plugin hex editor for NotePad++. Opened an mp3 file in it. Everything was done according to the formula. I subtracted id3 data from the file size in bytes, then divided by the duration in seconds and got the size of one second in bytes. I tried to cut the first 30 seconds of the song. It happened to the nearest fraction of a second. The first 2 songs cut successfully. But there were problems with the third song. A picture is sewn into it and when I cut, at the output the song starts a second and a half earlier than necessary. So I don't understand what the problem is. Of course, I take into account the size of the picture. It is in id3 data and I subtract its size before dividing by seconds.
If someone is interested in understanding and at the same time helping, you can download the problematic song from the link in the comments. Tried to cut the first 68 seconds.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Pukhov, 2015-06-05
@Neuroware

Why not immediately cut in a notebook?
If, in fact ,
ffmpeg -ss 00:00:30.00 -t 25 -i bar.mp3 -acodec copy bar-new.mp3
cuts with any accuracy any file that you feed, even video

K
kn1ght_t, 2015-06-04
@kn1ght_t

download a song without a picture and don't worry

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question