Namespaces
Variants
Actions

Archived:How to get id3 tag from a MP3 file using PySymbian

Jump to: navigation, search
Archived.png
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
Article Metadata

Article
Created: cyke64 (29 Mar 2007)
Last edited: hamishwillee (08 May 2013)

There's no function for getting info about a mp3 file. So there's a function to this use.


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)
year = fp.read(4)
comment = fp.read(28)
 
fp.close()
 
return {'title':title, 'artist':artist, 'album':album, 'year':year}

If a file name ex.mp3 exists in c:\\others you get the real title not based on the filename !

info = getID3('c:\\ex.mp3')
print 'the title is ',info['title']
This page was last modified on 8 May 2013, at 14:52.
202 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved