Advertisement
Guest User

Mp3 Idv1

a guest
Feb 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.75 KB | None | 0 0
  1. mp3_file_name = "John_Wesley_Coleman_-_07_-_Tequila_10_Seconds.mp3"
  2.  
  3. with open(mp3_file_name ,"rb") as file_identifier:
  4.     file_identifier.seek(-128, 2) #from end of file shift backwards by 128 bytes
  5.     # typedef struct
  6.     # {
  7.     #    char tag[3];         // 3 byte(s)
  8.     #    char title[30];      //30 byte(s)
  9.     #    char artist[30];     //30 byte(s)
  10.     #    char album[30];      //30 byte(s)
  11.     #    char year[4];        // 4 byte(s)
  12.     #    char comment[30];    //30 byte(s)
  13.     #    unsigned char genre; // 1 byte(s)
  14.     # } mp3Tag ;   
  15.     tag     = file_identifier.read(3) # 3 byte(s)
  16.     #title   =     #30 byte(s)
  17.     #artist  =     #30 byte(s)
  18.     #album   =     #30 byte(s)
  19.     #year    =     # 4 byte(s)
  20.     #comment =     #30 byte(s)
  21.     #genre   =     #1 byte(s)
  22.    
  23. print tag
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement