NYCPHP Meetup

NYPHP.org

[nycphp-talk] Reading/writing id3v2 tags from MP3 files in PHP?

Mark Armendariz lists at enobrev.com
Thu Aug 4 21:58:17 EDT 2011


To add to this, there is a fantastic python module called mutagen that
does a pretty incredible job of reading and writing id3 tags.  I used
it pretty heavily on an enormous music-based php project that manages
tens of thousands of mp3s.

http://code.google.com/p/mutagen/

Mark

On Thu, Jul 28, 2011 at 8:19 AM, David Roth <davidalanroth at gmail.com> wrote:
> Hi Nick.
>
> Thanks for the reply. It turns out for writing tags, those PHP routines
> don't support v2 which I needed.
>
> Now for the gory details. :-)
>
> However, I did find a solution that worked. There is a command line Linux
> utility called id3v2 which I installed on CentOS.
>
> I ended up writing a PHP program which wrote a shell script to handle the
> passing of the data needed for the parameters to id3v2. Then I ran the shell
> script.
>
> I did want to get the program length of each MP3 to write this to a MySQL
> database, so I did use PHP's shell_exec with command line mp3info to get the
> program runtime.
>
> The other thing I learned about this is that iTunes uses a later version of
> id3v2 (id3v2.2), so you can't write all the tags it uses with the id3v2
> software although it can read it.
>
> And to convert them to podcast files which remember the position and to skip
> during shuffle, that actually had to be done in iTunes itself. Apparently
> that is a function of iTunes and likely stored in its own XML file. Luckily,
>  the user can select multiple MP3 files after they have been imported to
> iTunes and globally change them to do this.
>
> All this helped make an archive of old radio shows much more enjoyable to
> use.
>
> David Roth
>
>
>> Hi David,
>>
>> PHP has ID3 functions. Here's where you can find it in the reference
>> manual: http://php.net/id3
>>
>> Cheers!
>>
>> Nick
>
> _______________________________________________
> New York PHP Users Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/Show-Participation
>



More information about the talk mailing list