mutagen icon indicating copy to clipboard operation
mutagen copied to clipboard

mutagen.mp3.HeaderNotFoundError: can't sync to MPEG frame

Open ChickenNugget25 opened this issue 3 years ago • 8 comments

I've done a little bit of searching on this error and I found that it's thrown when the .mp3 file passed is corrupted or 'not a real mp3' The .mp3 that's throwing the error is one I made with the package pyttsx3, and it runs fine through windows media player, but still has the error. What should I do?

ChickenNugget25 avatar Jun 12 '22 15:06 ChickenNugget25

I'm glad someone else had this problem, I did a little debugging and it looks like mutagen only supports a handful of mp3 formats. pyttsx3 writes its mp3 files in pcm_s16le format, but mutagen can't read that. Right now, the best thing to do is use FFMPEG's tools for this or use .wav files. But I'd love to see this problem fixed in the future.

Ocean-Spud avatar Sep 03 '22 21:09 Ocean-Spud

An example file would be helpful to debug this.

lazka avatar Sep 04 '22 03:09 lazka

Hi, I have the same problem processing the meta info this file. I m Coming Home .zip

 from mutagen.mp3 import MP3
 return MP3(path)

0220905155106

QY-Y avatar Sep 05 '22 07:09 QY-Y

I ran into this one as well.

Tailslide avatar Jan 17 '23 03:01 Tailslide

Don't know why it happens, but I solved it out with ffmpeg.

ffmpeg -i a.mp3 b.mp3 

Putting b.mp3 didn't have any problem for my case.

Pimool avatar Oct 11 '23 09:10 Pimool

hi! I ran into this problem. I have a script downloading mp3 files and since the script is not running on my machine it's preferred that I don't re-encode it (I can do it only with a portable ffmpeg build, but that is ~80mb that I don't want to have where my script is hosted). is there a workaround for this?

Mohammad9760 avatar Mar 01 '24 15:03 Mohammad9760

is there a way to fix this or should I try to fix the problem from the other end (the part of my script that downloads mp3s)

Mohammad9760 avatar Mar 01 '24 15:03 Mohammad9760