I want to change my music's cover image. I've tried:
我想改变我音乐的封面形象。我试过了:
from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3, APIC
audio = EasyID3('11.mp3')
audio['artist'] = "Artist"
audio['title'] = "11"
audio.save()
audio = ID3('11.mp3')
with open('img.jpg', 'rb') as albumart:
audio['APIC'] = APIC(
encoding=3,
mime='image/jpeg',
type=3, desc=u'Cover',
data=albumart.read()
)
audio.save()
But the cover has not changed. My project folder:
但封面并没有改变。我的项目文件夹:
project
--- main.py
--- 11.mp3
--- img.jpg
更多回答
If you open this file 11.mp3
in a specialized tool like Mp3tag, do you see the cover there?
如果你用像Mp3tag这样的专用工具打开这个11.mp3文件,你看到那里的封面了吗?
Then your code seems to work fine. You would have to check in your File Explorer (Windows?) why the thumbnail was/will not be created. As long as you see the cover art in Mp3tag, you can be sure, that the cover is embedded in 11.mp3
那么您的代码似乎运行得很好。您必须签入文件资源管理器(Windows?)创建/不创建缩略图的原因。只要您看到Mp3tag中的封面图片,就可以确定封面嵌入了11.mp3
But I use linux and I opened it with telegram and it works!
但我使用的是Linux,我用电报打开了它,它起作用了!
优秀答案推荐
You need to restart your file explorer
您需要重新启动文件资源管理器
更多回答
我是一名优秀的程序员,十分优秀!