我想编辑一个mp3文件的元数据。所以很多人使用mutagen建议 Image of properties of the mp3 file before running the program
运行程序前mp3文件的pprint输出
MPEG 1 layer 3, 273092 bps (VBR, LAME 3.99.1+), 44100 Hz, 2 chn, 278.87 seconds (audio/mp3)
album=Achcham Yenbadhu Madamaiyada
albumartist=A.R.Rahman
artist=Aditya Rao, Aaryan Dinesh Kanagaratnam, Sri Rascol
author=Thamarai, Madhan Karky, Vignesh Shivan, ADK, Sri Raskol & Pavendhar Bharathidasan
composer=A.R.Rahman
date=2016
discnumber=01/01
encodedby=music
genre=Tamil
lyricist=Thamarai, Madhan Karky, Vignesh Shivan, ADK, Sri Raskol & Pavendhar Bharathidasan
title=Showkali
tracknumber=01
version=music
我想改变这种类型,所以我这样做了:
import mutagen
path = 'C:/wamp/www/music/songs/Showkali.mp3'
m=mutagen.File(path,easy=True)
m['genre']='melody'
m.save()
print(m.pprint())
The properties of the mp3 file after running the above program
运行程序后mp3文件的pprint输出
MPEG 1 layer 3, 273092 bps (VBR, LAME 3.99.1+), 44100 Hz, 2 chn, 278.87 seconds (audio/mp3)
album=Achcham Yenbadhu Madamaiyada
albumartist=A.R.Rahman
artist=Aditya Rao, Aaryan Dinesh Kanagaratnam, Sri Rascol
author=Thamarai, Madhan Karky, Vignesh Shivan, ADK, Sri Raskol & Pavendhar Bharathidasan
composer=A.R.Rahman
date=2016
discnumber=01/01
encodedby=music
genre=melody
lyricist=Thamarai, Madhan Karky, Vignesh Shivan, ADK, Sri Raskol & Pavendhar Bharathidasan
title=Showkali
tracknumber=01
version=music
使用pprint()可以看到受影响的输出,但无法看到mp3属性选项卡中的大部分元数据,如图所示。 为什么会这样??有人能指出错误吗?...提前谢谢。