I've been using mutagen for reading and writing MP3 tags, but I want to be able to embed album art directly into the file.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Possible solution
Are you trying to embed images into a lot of files? If so, I found a script (see the link) that goes through a set of directories, looks for images, and the embeds them into MP3 files. This was useful for me when I wanted to actually have something to look at in CoverFlow on my (now defunct) iPhone.
A nice small CLI tool which helped me a lot with checking what I did while developing id3 stuff is mid3v2 which is the mutagen version of id3v2. It comes bundled with the Python mutagen library. The source of this little tool gave me also lots of answers about how to use mutagen.
I've used the eyeD3 module to do this exact thing.
Looks like you have to add a special type of frame to the MP3. See the site on ID3 tags
Also the tutorial for mutagen implies that you can add ID3 tags in mutagen see
Here is how to add example.png as album cover into example.mp3 with mutagen: