Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening MP3 files with text editors [closed]

I have a question:

When I open an mp3 file with a text editor(sublime text), a few hundred thousand numbers in 4 digits appear(like picture below).

enter image description here

I got curious and experimented, deleting sections of the file and playing the mp3 file.

When I deleted the first parts, the music played but the file's CD artwork disappeared. When I deleted a huge chunk of the middle section, the music played but was shortened, with the middle part of the song gone.

Do you know what each part of the picture-letter combination represents?

I want to manipulate mp3 files(slow them down, lower the pitch, etc.) with python by modifying these numbers.

Do you have any insight on this, or what I can google to further explore?

Thanks!

like image 913
user3431429 Avatar asked Sep 08 '25 04:09

user3431429


1 Answers

I would suggest looking at an MP3 file structure specification. Each MP3 file is composed of multiple frames and tags. Those hex values you are looking at hold the content for each frame. Modifying each frame will allow you to adjust the sampling rate and bitrate.

For more in-depth information on the MP3 specification, I would take a look at

http://www.multiweb.cz/twoinches/mp3inside.htm

like image 158
DanGar Avatar answered Sep 10 '25 20:09

DanGar