There are a lot of libs to work with mp3 tags, but I need just 2 functions - split mp3 file in 2 parts and the second one to merge 5 mp3.
Can you suggest anything? Thanks!
There are a lot of libs to work with mp3 tags, but I need just 2 functions - split mp3 file in 2 parts and the second one to merge 5 mp3.
Can you suggest anything? Thanks!
I don't see why you would need such a lib. You just have to put one part in one file, and the other one in an other file, and know which is the first part.
Just a guess.
Have a look at the MP3 file structure on Wikipedia. Use binary read mode in python to edit the MP3 file. s = open(file_name, 'rb').read()
will put the whole file into a string object representing the raw bytes in your file (e.g. \xeb\xfe\x80
). You can then search and edit the string, addressing the byte offsets with indeces using brackets: s[n]
. Finally, just do a binary write of the MP3 frames you want in your new file(s), appending the ID3 header to the set of frames that you want to make up each file.