How to merge wma files to mp3 (with header editing)?

152 views Asked by At

I have some .wma file which I am trying to merge into a single one... I started with python reading files in bytes and writing them into a new one, just as I tried the cmd command copy /b file1.wma + file2.wma + else.wma total.wma all came up with the same result: my total file was as large in byte as real total of my segments, but when I try to open the file it plays the first segment both in length(time) and content -meaning that I have a 15 MB 10 second voice :-))

I tried to do that with different .wma files but each time it is the first one in length and content and total of them in size.

My assumption is that probably some were my .wma data frame (maybe in file header) there is a data about length of current file, so that after merging the file when the player attempts to play the file reads that data about time and stops after the time. or some like that. so I need to edit those data frame or header (if even exist) in a way that matches my final output or just simply ignore that. but I don't know whether it is right or how I can do that

.wma file sample: https://github.com/Fsunroo/PowerPointVoiceExtract (media1.wma and media2.wma for example) note: there is no such problem with web applications that join songs (maybe they do editing header??!)

Note2: it is a part of my code witch extract voice from a power point file.

1

There are 1 answers

0
mohammad farhady On

I solved the problem by using moviepy.editor

the corrected project is accessible at: https://github.com/Fsunroo/PowerPointVoiceExtract