本文例項講述了Python從MP3檔案獲取id3的方法。分享給大家供大家參考。具體如下:
def getID3(filename):
fp = open(filename, 'r')
fp.seek(-128, 2)
fp.read(3) # TAG iniziale
title = fp.read(30)
artist = fp.read(30)
album = fp.read(30)
anno = fp.read(4)
comment = fp.read(28)
fp.close()
return {'title':title, 'artist':artist, 'album':album, 'anno':anno}
希望本文所述對大家的Python程式設計有所幫助。
您可能感興趣的文章:
python實現ID3決策樹演算法python實現決策樹C4.5演算法詳解(在ID3基礎上改進)基於ID3決策樹演算法的實現(Python版)Python讀取mp3中ID3資訊的方法python程式碼實現ID3決策樹演算法
写评论
很抱歉,必須登入網站才能發佈留言。