<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Navarr&#039;s Tech Side &#187; class::mp3Data</title>
	<atom:link href="http://tech.navarr.me/topics/code/php-code/mp3data/feed" rel="self" type="application/rss+xml" />
	<link>http://tech.navarr.me</link>
	<description>The Technical Side of my Life</description>
	<lastBuildDate>Tue, 07 Feb 2012 22:32:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<cloud domain='tech.navarr.me' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Small Update: class::mp3Data v0.2</title>
		<link>http://tech.navarr.me/2009/09/small-update-classmp3data-v0-2.html</link>
		<comments>http://tech.navarr.me/2009/09/small-update-classmp3data-v0-2.html#comments</comments>
		<pubDate>Sat, 12 Sep 2009 04:42:47 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[class::mp3Data]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[song]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2009/09/small-update-classmp3data-v0-2.html</guid>
		<description><![CDATA[I just wanted to publish a small blog post letting you know that I have updated the mp3Data class to version 0.2. Change log: Added function getArts() to retrieve ALL artwork embedded in ID3v2.&#160; These function returns an ordered array of PHP Image Resources. Hope that if you use it, you enjoy the small change [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to publish a small blog post letting you know that I have updated the mp3Data class to version 0.2.</p>
<p><strong>Change log:</strong></p>
<ul>
<li>Added function getArts() to retrieve ALL artwork embedded in ID3v2.&#160; These function returns an ordered array of PHP Image Resources.</li>
</ul>
<p>Hope that if you use it, you enjoy the small change (not that it will be useful to many people)! </p>
<p>Code is located <a href="http://pastebin.ca/1562826">at pastebin</a> and retains the same usage permissions as <a href="http://tech.gtaero.net/2009/09/php-class-mp3data-get-id3-info-from-mp3.html">v0.1</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2009/09/small-update-classmp3data-v0-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP class mp3Data – Get ID3 Info from MP3</title>
		<link>http://tech.navarr.me/2009/09/php-class-mp3data-get-id3-info-from-mp3.html</link>
		<comments>http://tech.navarr.me/2009/09/php-class-mp3data-get-id3-info-from-mp3.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 21:09:49 +0000</pubDate>
		<dc:creator>Navarr</dc:creator>
				<category><![CDATA[class::mp3Data]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[id3]]></category>
		<category><![CDATA[id3v2]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://tech.gtaero.net/2009/09/php-class-mp3data-get-id3-info-from-mp3.html</guid>
		<description><![CDATA[So recently, I submitted a bid on a project to make a lyrics website using PHP.&#160; I haven’t been contacted about whether or not I won the bid yet, but I decided that I might as well start some preliminary work on backend coding – It’ll make my life easier, and deliver a faster and [...]]]></description>
			<content:encoded><![CDATA[<p>So recently, I submitted a bid on a project to make a lyrics website using PHP.&#160; I haven’t been contacted about whether or not I won the bid yet, but I decided that I might as well start some preliminary work on backend coding – It’ll make my life easier, and deliver a faster and better result to the client, so why not?</p>
<p>Why am I mentioning this, you ask?&#160; What does my personal life have to do with my tech blog?&#160; Well, I’m getting to that!</p>
<p>I almost immediately thought.&#160; “Hey, wouldn’t it be really cool if the admin of the website could simply upload an MP3 file and pull almost, if not all of the data from it to use on the site?” After which, I quickly searched around for something that would allow me to do just that, to read the ID3 tags on an MP3 file.</p>
<p>The first thing I came to, was the search result on the PHP website for “id3,” the <a href="http://www.php.net/manual/en/book.id3.php">ID3 PECL Library</a>.&#160; Unfortunately, after trying for a very long time on DreamHost, I not only couldn’t get it to install, but had just wasted probably an hour in an attempt to.&#160; Not only that, but the library was still in its alpha stage.</p>
<p>Some quick internet searching took me to the <a href="http://getid3.sourceforge.net/">getid3 library</a>, a robust library programmed to read ID3 data tags (and other types of metadata?) from almost any type of file.&#160; I quickly set about to using it, and found its internal structure complicated and confusing.&#160; It didn’t even offer me a quick and easy way to access the album artwork.</p>
<p>After a good period of time learning some of the basic structure of ID3 and how the getid3 library worked, I set about to coding up a library of my own to quickly interface with getid3 and retrieve the information I needed.</p>
<p>The result is <a href="http://pastebin.ca/1562826">class::mp3Data</a>.&#160; A very, very simple library built exclusively to interface with getid3 and retrieve basic information about an mp3 file while still retaining more advanced information for coders who need it.&#160; Take a look at some example code and the licensing permissions after the break.</p>
<p><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/80x15.png" /></p>
</p>
<p> <span id="more-106"></span>
</p>
<p>Retrieving and Displaying the Artwork as a Picture:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> &lt;?php</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">require_once</span>(<span style="color: #006080">&quot;mp3Data.class.php&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     $data = <span style="color: #0000ff">new</span> mp3Data(<span style="color: #006080">&quot;filename.mp3&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     $img = $data-&gt;getArt();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">if</span> ($img)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>         header(<span style="color: #006080">&quot;Content-type: image/jpeg&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         imagejpeg($img);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> ?&gt;</pre>
<p><!--CRLF--></div>
</div>
<p>Displaying Basic Data:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> &lt;?php</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">require_once</span>(<span style="color: #006080">&quot;mp3Data.class.php&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     $data = <span style="color: #0000ff">new</span> mp3Data(<span style="color: #006080">&quot;filename.mp3&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">print</span>(<span style="color: #006080">&quot;Title: &quot;</span>.$data-&gt;getName().<span style="color: #006080">&quot;&lt;br /&gt;&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">print</span>(<span style="color: #006080">&quot;Album: &quot;</span>.$data-&gt;getAlbum().<span style="color: #006080">&quot;&lt;br /&gt;&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #0000ff">print</span>(<span style="color: #006080">&quot;Artist: &quot;</span>.$data-&gt;getArtist());</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> ?&gt;</pre>
<p><!--CRLF--></div>
</div>
<p>You can copy the source code from <a href="http://pastebin.ca/1562826" rel="nofollow">pastebin at this link</a>.</p>
<p>Licensing Permissions:</p>
<p><a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/80x15.png" /></a></p>
<div style="display: none">
<p><span rel="dc:type" property="dc:title" href="http://purl.org/dc/dcmitype/Text" xmlns:dc="http://purl.org/dc/elements/1.1/">class::mp3Data</span> by <a href="http://www.koneko-chan.net/people/Navarr" rel="cc:attributionURL" property="cc:attributionName" xmlns:cc="http://creativecommons.org/ns#">Navarr Barnier</a> is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License</a>. </p>
<p>Based on a work at <a href="http://pastebin.ca/1562826">pastebin.ca</a>.</p>
<p>Permissions beyond the scope of this license may be available at <a href="mailto:navarr@koneko-chan.net" rel="cc:morePermissions" xmlns:cc="http://creativecommons.org/ns#">mailto:navarr@koneko-chan.net</a>.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://tech.navarr.me/2009/09/php-class-mp3data-get-id3-info-from-mp3.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

