We Recommend

Learning Python Learning Python
The authors of Learning Python show you enough essentials of the Python scripting language to enable you to begin solving problems right away, then reveal more powerful aspects of the language one at a time. This approach is sure to appeal to programmers and system administrators who have urgent problems and a preference for learning by semi-guided experimentation.


Posted By

whitetiger on 11/09/06


Tagged

database sql start python open repeat music audio mp3 record series60 hello sound id3 sms phonebook app


Versions (?)


Who likes this?

5 people have marked this snippet as a favorite

anayhk
vvarp
urandom
fukami
chrisaiv


Python - Get id3 from MP3 File


Published in: Python 


  1. def getID3(filename):
  2. fp = open(filename, 'r')
  3. fp.seek(-128, 2)
  4.  
  5. fp.read(3) # TAG iniziale
  6. title = fp.read(30)
  7. artist = fp.read(30)
  8. album = fp.read(30)
  9. anno = fp.read(4)
  10. comment = fp.read(28)
  11.  
  12. fp.close()
  13.  
  14. return {'title':title, 'artist':artist, 'album':album, 'anno':anno}

Report this snippet 

You need to login to post a comment.