MP3 Info + Documentation
Notes:
- This module supersedes the MP3 Info + Plugin which will no longer be maintained. If you used it, you can remove it.
- This module requires the cache-folder in your ExpressionEngine system directory to be writeable by ExpressionEngine. A folder named ‘MP3_info’ will be created there where cached file-information will be stored.
Installation:
- Unzip the archive.
- Copy the folder named mp3_info into the modules folder inside your system-directory.
- Copy the file named lang.mp3_info.php into the /language/english folder inside your system-directory.
- Navigate to Modules in your EE CP and find the module named MP3 Info. Click Install.
Tag
{exp:mp3_info:show file="http://mytestdomain.org/mp3/Hollow_Years.mp3" path="/home/noone/htdocs/mp3/"}
{/exp:mp3_info:show}
Parameters:
We need the full path to the mp3-file. There are two parameters to achieve this:
file=""
- If this is the full path + the filename, the path-parameter must not be used.
- If this is the filename only, specify the path in the path-parameter.
- If this is the URL to the file, the filename will be extracted. Specify the path in the path-parameter.
path=""
The full path to the file. Use only in cases 2. and 3. explained above.
Variables:
General MPEG information:
{mpeg_version_id}
Version ID
{mpeg_version}
Version
{mpeg_layer_id}
Layer ID
{mpeg_layer}
Layer
{mpeg_protection}
Protection
{mpeg_bitrate}
Bitrate
{mpeg_sample_rate}
Sampe Rate:
{mpeg_private}
Private
{mpeg_channels}
Channels
{mpeg_channelmode}
Channelmode
{mpeg_copyright}
Copyright
{mpeg_original}
Original
General information:
{filesize}
Filesize in human-readable format
{filesize_bytes}
Filesize in bytes
{playtime_string}
Playtime of the MP3, e.g.: 05:53
{playtime_seconds}
Playtime of the MP3 in full seconds, e.g. 344
ID3v1 Tags:
{id3v1_title}
Song Title (max. 30 characters)
{id3v1_artist}
Artist (max. 30 characters)
{id3v1_album}
Album (max. 30 characters)
{id3v1_year}
Year
{id3v1_comment}
Comment (max. 30 characters)
{id3v1_track}
Track
{id3v1_genre_id}
Genre ID
{id3v1_genre}
Genre
ID3v2 Tags:
{id3v2_comments}
COMM [#sec4.11 Comments]
{id3v2_album}
TALB [#TALB Album/Movie/Show title]
{id3v2_composer}
TCOM [#TCOM Composer]
{id3v2_content_type}
TCON [#TCON Content type] aka Genre
{id3v2_copyright_message}
TCOP [#TCOP Copyright message]
{id3v2_title}
TIT2 [#TIT2 Title/songname/content description]
{id3v2_original_artist}
TOPE [#TOPE Original artist(s)/performer(s)]
{id3v2_artist}
TPE1 [#TPE1 Lead performer(s)/Soloist(s)]
{id3v2_band}
TPE2 [#TPE2 Band/orchestra/accompaniment]
{id3v2_tpos}
TPOS [#TPOS Part of a set]
{id3v2_publisher}
TPUB [#TPUB Publisher]
{id3v2_track}
TRCK [#TRCK Track number/Position in set]
{id3v2_tsse}
TSSE [#TSEE Software/Hardware and settings used for encoding]
{id3v2_year}
TYER [#TYER Year]
{id3v2_uslt}
USLT [#sec4.9 Unsychronized lyric/text transcription]
{id3v2_uslt_br}
USLT [#sec4.9 Unsychronized lyric/text transcription]
In this variable the linebreaks have been replaced by <br />-tags.
ID3v2 Variable Pairs:
{id3v2_apic} {/id3v2_apic}
APIC [#sec4.15 Attached picture]
You can embed any number of images into an MP3-file. The {id3v2_apic}-variable will loop through them.
Example:
{id3v2_apic}
<img src="{image_url}" width="{image_width}" height="{image_height}" alt="{image_description}" /> <br />
{/id3v2_apic}
{id3v2_apic} variables:
{image_description}
The description text of the actual image.
{image_height}
The height of the actual image.
{image_typeid}
The type ID of the actual image.
{image_type}
The textual representation of the type of the actual image .
{image_url}
The URL of the actual image. This will be created on the fly.
{image_width}
The width of the actual image.
If your files contain multiple images and you want to only display (a) specific picture type(s), you can use conditionals based on {image_typeid}.
Show only the “Cover (front)” image:
{id3v2_apic}
{id3v2_apic}
{if {image_typeid} == 3}
<img src="{image_url}" width="{image_width}" height="{image_height}" alt="{image_description}" /> <br />
{/if}
{/id3v2_apic}
+---+------------------------------------+
|ID | PICTURE TYPE |
+---+------------------------------------+
|0 | Other |
|1 | 32x32 pixels 'file icon' (PNG only)|
|2 | Other file icon |
|3 | Cover (front) |
|4 | Cover (back) |
|5 | Leaflet page |
|6 | Media (e.g. lable side of CD) |
|7 | Lead artist/lead performer/soloist |
|8 | Artist/performer |
|9 | Conductor |
|10 | Band/Orchestra |
|11 | Composer |
|12 | Lyricist/text writer |
|13 | Recording Location |
|14 | During recording |
|15 | During performance |
|16 | Movie/video screen capture |
|17 | A bright coloured fish |
|18 | Illustration |
|19 | Band/artist logotype |
|20 | Publisher/Studio logotype |
+---+------------------------------------+
Questions / bug reports
For general comments, brickbats & bouquets please use the form over here.User Talk
2012-01-16 10:01
I like it, but I don’t whether there are some updates? This is what I need.
2011-12-12 11:45
hope that is open source what you said above because I will use it in the future.
2011-11-28 20:00
Thank you for the article. I will use you advice for my future projects.
2011-01-24 16:22
I have updated this to work with EE2 (and I did contact Silenz about it but got no response). I’m hesitant to hand the updated plugin out as I didn’t make it so can’t really take credit for it.
If Silenz wants I will happily send this across so he can update this site and offer it to download.
2011-01-24 16:09
Ditto about an update for EE2. This would be very helpful! Thanks for anything you can do.
2011-01-24 16:03
Hello
I was just wondering if this is going to be updated to work with EE 2.0 or if you know of any alternative?
Any help would be much appreciated.
All the best,
Rury
2010-07-17 18:13
Could you give me an actual example showing this module in place in a script. I have the plugin installed and have been using it for a long time now. But, I’ve installed the module according to the instructions and have installed it utilizing the EE Control Panel, but I can’t seem to make it work. Surely I’m missing something but I can’t figure it out.
Thanks
2009-11-29 00:45
Two questions
1) So in theory, I could grab the template variables and write them back to the DB using a SQL statement, eh?
2) I saw someone else asked about other audio formats, that’s a good question. But I am curious to know if you’ve considered making it work for images?
2009-11-23 23:38
This module is fantastic, and solves a cool problem for me. Know of a way to do this with video as well, like mp4 files?
2009-09-15 18:37
We have been using the MP3 Plus module since the first of the year and all seems well, minus a few things here and there. Today though, we did run into a new issue and I am curious if this is a bug or a limitation. Every MP3 added (which we are using for podcasts) creates a file in the MP3_info cache folder. Today it stopped creating the files. After renaming the mp3_info cache folder, the problem was resolved. At the time it stopped working there were 233 files in the cache folder. Is there a limit to 233 files? Is this a system limitation or something… or was it just a fluke. Thanks,
Jeff