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?
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).
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!
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!
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.
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!
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?
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.
Can’t wait to get this module working, however I’m can’t seem to get it to spit out anything. Installed it as usual on 1.6.8. Here is my code:
{exp:mp3_info:show file='/media/audio/STE-008.mp3'} This is a MP3 file: version: {mpeg_version_id} Time: {playtime_seconds} Size: {filesize} {/exp:mp3_info:show}
This unfortunately returns nothing.
Here is what I am getting from template debugging:
(0.009784) Parsing Tags in Template (0.009820) Tag: {exp:mp3_info:show file='/media/audio/STE-008.mp3'} (0.009946) Closing Tag Found (0.010006) Processing Tags (0.010030) Module Tag: Mp3_info/show (0.010047) Including Files for Tag and Modules (0.039456) Beginning Final Tag Data Processing (0.039490) Calling Class/Method: Mp3_info/show (0.039690) -> Class Called: Mp3_info (0.039715) -> Method Called: show (0.040183) -> Data Returned