Parsing MP3 Metadata (ID3 Tags)
Posted: 09 January 2009 02:57 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

I was just wondering if anyone had ever looked into parsing the metadata (the ID3 tags) for MP3 files. I’m aware that people can associate a title, genre, author, year, comment, duration, bit rate, image and so on with an MP3.

So I was wondering if, rather than have a user enter all this information again into custom fields for a weblog whose entries include mp3’s, they could be automatically pulled from the file?

Any thoughts or ideas anyone?

Profile
 
 
Posted: 09 January 2009 03:29 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21123
Joined  05-15-2004

Check out this plugin, not aware of anything else.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 09 January 2009 07:08 AM   [ Ignore ]   [ # 2 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

Or rather this plugin if you want ID3 (only ID3v1.1 though) information.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 09 January 2009 07:13 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

Thanks Ingmar and Silenz,

The ID3v1.1 is exactly what i need.

Profile
 
 
Posted: 11 January 2009 02:49 PM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

A hopefully quick question…

I followed the instructions in the documentation for the ID3v1.1 plugin and entered this into my template (first on its own, and then within weblog entries tags).

{exp:mp3info_plus file="http://www.mosaic-church.org.uk/creative_arts_showcase/example.mp3" path="/var/www/vhosts/mosaic-church.org.uk/httpdocs/creative_arts_showcase/"}
Artist
: {artist}<br />
Length: {length}
{
/exp:mp3info}

It doesn’t pull the information from the track and just displays “{artist}” and “{length}”

Any ideas why? the documentation is pretty vague about how/where to use it.
Thanks

Profile
 
 
Posted: 11 January 2009 02:53 PM   [ Ignore ]   [ # 5 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

Haha, as usual, I post a help request and then immediately see where the problem was.

The closing {/exp:mp3info} tag needed to be {/exp:mp3info_plus}

Note: I did copy this straight from the site Silenz linked to so just be aware it will need amending if anybody else does the same. Great little plugin!

Profile
 
 
Posted: 11 January 2009 03:09 PM   [ Ignore ]   [ # 6 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

I’m back again with another issue… I do apologize

Having got the plugin working somewhat correctly, I have discovered having gone through the list of possible variables that it doesn’t actually pull in any of the ID3v1 tags (though I checked and the mp3 files do have the information attached)

And i’ve just noticed that the length parameter brings back the wrong value. In one example it says 5.22 but the track is actually only 4:18. Over a one minute inconsistency!

Any ideas?
Thanks

Profile
 
 
Posted: 11 January 2009 06:39 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

Fixed the type with the closing tag.

For the http://www.mosaic-church.org.uk/creative_arts_showcase/example.mp3 I get:

ID3v1 Name:     Night
ID3v1 Artist
:   Killeen and Gieson
ID3v1 Album
:    Miserable Songs
ID3v1 Year
:     2004
ID3v1 Comment
:  http://www.wimpyplayer.com/eco
ID3v1 Track:    
ID3v1 Genre No: 255
ID3v1 Genre
:

Length is somewath off, true. Will look into it.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 12 January 2009 02:58 AM   [ Ignore ]   [ # 8 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

Thanks for having a look.

Theres just one other thing I noticed. In the top left corner of my browser (FF3) there is “no tag no tag” written which must be coming from the plugin as when it’s removed that text isnt displayed.

Any ideas what it could be?

Take a look here http://www.mosaic-church.org.uk/creative_arts/showcase

Thanks again for your time

Profile
 
 
Posted: 12 January 2009 06:21 AM   [ Ignore ]   [ # 9 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

That’s a debug message that has been removed in v.1.0.1. It occurs when the plugin encounters an Mp3 that has no properly encoded tags.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 12 January 2009 06:38 AM   [ Ignore ]   [ # 10 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

Great, that debug message has gone now thanks.

Do you plan to develop this plugin further to allow for images/lyrics and so on? I’m just barely scratching the surface of the whole ID3 stuff but it seems it could make for some real useful projects down the line.

Anyway, thanks for putting together this super plugin and for sorting out the problems i was having!

Profile
 
 
Posted: 13 January 2009 04:19 AM   [ Ignore ]   [ # 11 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

The plugin will undergo some major changes in the near future, yes.
Do you happen to know a good tag-editor that supports Lyrics?

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 13 January 2009 04:25 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Avatar
Rank
Total Posts:  76
Joined  10-22-2008

I’ve been using this one - ID3Editor

Works on Mac and PC

Profile
 
 
Posted: 15 January 2009 09:59 AM   [ Ignore ]   [ # 13 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

Well, the next release will have much improved playtime calculation.

Basic ID3v2-support has been added (see list below) including attached images and unsychronized lyrics.

APIC    [#sec4.15 Attached picture]
COMM    [#sec4.11 Comments]
TALB    [#TALB Album/Movie/Show title]
TCOM    [#TCOM Composer]
TCON    [#TCON Content type]
TCOP    [#TCOP Copyright message]
TIT2    [#TIT2 Title/songname/content description]
TOPE    [#TOPE Original artist(s)/performer(s)]
TPE1    [#TPE1 Lead performer(s)/Soloist(s)]
TPE2    [#TPE2 Band/orchestra/accompaniment]
TPOS    [#TPOS Part of a set]
TPUB    [#TPUB Publisher]
TRCK    [#TRCK Track number/Position in set]
TSSE    [#TSEE Software/Hardware and settings used for encoding]
TYER    [#TYER Year]
USLT    [#sec4.9 Unsychronized lyric/text transcription]

ID3v2.3 has a plethora of possible content frames. Many will probably seldom be used.

I just wonder which of the remaining might be of general interest:

AENC    [#sec4.20 Audio encryption]
COMR    [#sec4.25 Commercial frame]
ENCR    [#sec4.26 Encryption method registration]
EQUA    [#sec4.13 Equalization]
ETCO    [#sec4.6 Event timing codes]
GEOB    [#sec4.16 General encapsulated object]
GRID    [#sec4.27 Group identification registration]
IPLS    [#sec4.4 Involved people list]
LINK    [#sec4.21 Linked information]
MCDI    [#sec4.5 Music CD identifier]
MLLT    [#sec4.7 MPEG location lookup table]
OWNE    [#sec4.24 Ownership frame]
PRIV    [#sec4.28 Private frame]
PCNT    [#sec4.17 Play counter]
POPM    [#sec4.18 Popularimeter]
POSS    [#sec4.22 Position synchronisation frame]
RBUF    [#sec4.19 Recommended buffer size]
RVAD    [#sec4.12 Relative volume adjustment]
RVRB    [#sec4.14 Reverb]
SYLT    [#sec4.10 Synchronized lyric/text]
SYTC    [#sec4.8 Synchronized tempo codes]
TBPM    [#TBPM BPM (beats per minute)]
TDAT    [#TDAT Date]
TDLY    [#TDLY Playlist delay]
TENC    [#TENC Encoded by]
TEXT    [#TEXT Lyricist/Text writer]
TFLT    [#TFLT File type]
TIME    [#TIME Time]
TIT1    [#TIT1 Content group description]
TIT3    [#TIT3 Subtitle/Description refinement]
TKEY    [#TKEY Initial key]
TLAN    [#TLAN Language(s)]
TLEN    [#TLEN Length]
TMED    [#TMED Media type]
TOAL    [#TOAL Original album/movie/show title]
TOFN    [#TOFN Original filename]
TOLY    [#TOLY Original lyricist(s)/text writer(s)]
TORY    [#TORY Original release year]
TOWN    [#TOWN File owner/licensee]
TPE3    [#TPE3 Conductor/performer refinement]
TPE4    [#TPE4 Interpreted, remixed, or otherwise modified by]
TRDA    [#TRDA Recording dates]
TRSN    [#TRSN Internet radio station name]
TRSO    [#TRSO Internet radio station owner]
TSIZ    [#TSIZ Size]
TSRC    [#TSRC ISRC (international standard recording code)]
TXXX    [#TXXX User defined text information frame]
UFID    [#sec4.1 Unique file identifier]
USER    [#sec4.23 Terms of use]
WCOM    [#WCOM Commercial information]
WCOP    [#WCOP Copyright/Legal information]
WOAF    [#WOAF Official audio file webpage]
WOAR    [#WOAR Official artist/performer webpage]
WOAS    [#WOAS Official audio source webpage]
WORS    [#WORS Official internet radio station homepage]
WPAY    [#WPAY Payment]
WPUB    [#WPUB Publishers official webpage]
WXXX    [#WXXX User defined URL link frame]

     

To be able to dynamically display images embedded in mp3s I had to turn the plugin into a module.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 21 January 2009 08:43 AM   [ Ignore ]   [ # 14 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

The plugin is now deprecated.

A new version has been released in form of a module. New features have been added and existing ones have been improved.

Note that some variables have changed as well.

 Signature 

utilitees - Addons for EE

Profile
 
 
Posted: 03 February 2009 07:15 PM   [ Ignore ]   [ # 15 ]  
Summer Student
Total Posts:  30
Joined  02-01-2006

I am trying to use this plugin for a page using related entries.  When doing so, I receive the following error.

Notice: Undefined index: musicdept_song in /home/web/public_html/ee_site/modules/mp3_info/mod.mp3_info.php on line 259

Here is my code for this part of the page.

{exp:weblog:entries weblog="musicdept" category="57"}
{related_entries id
="musicdept_song"}
<tr>
<
p>

{exp:mp3_info:show file="/musicdept/music/You_Are_Holy.mp3" path="/home/web/public_html/musicdept/music"}
Title
: <b>{id3v2_title}</b> <br>
By: {id3v2_artist} <br>
Filesize: {filesize} <br>
Duration: {playtime_string} <br>
{/exp:mp3_info:show}

</p>
</
tr>

{/related_entries}
{
/exp:weblog:entries}

musicdept_song is the related custom field where the actual song information is being stored.  The interesting part is, the ID3tag is retrieved and shown even with the error. 

Anyone tried using this plugin with related fields yet? smile

Profile
 
 
Posted: 04 February 2009 06:40 AM   [ Ignore ]   [ # 16 ]  
Lab Technician
RankRankRankRank
Total Posts:  1158
Joined  10-22-2006

I’m tempted to say that this warning stems from a glitch in the EE-API. It is however easily to circumvent so you don’t have to wait, while I investigate.

If you re-download the module and replace mod.mp3_info.php the notice goes away.

On a sidenote:

{exp:mp3_info:show file="/musicdept/music/You_Are_Holy.mp3"}

If the file-parameter already contains the full path to the file like in your example you don’t need the path=”“.

 Signature 

utilitees - Addons for EE

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 77572 Total Logged-in Users: 31
Total Topics: 101562 Total Anonymous Users: 20
Total Replies: 544412 Total Guests: 260
Total Posts: 645974    
Members ( View Memberlist )
Newest Members:  Mark2009Idril616tonybernardcarterstarksColeJLinskitnealsemperjrawhallshiusbozzly