Re: MP3s

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



GH wrote:
> I am working on a PHP based website and would like to offer media to
> my visitors... I have the Audio in WMA and MP3 formats... I would like
> to know how I could get them to "Stream"? inline... using PHP.... any
> advice would be greatfully appreciated

Having done this (a lot) I'll add some notes to the fine answers already
provided.

#1. It's .m3u not .m3a :-)

#2. I have NO IDEA if putting WMA files in .m3u playlists works, and don't
care, because .wma files suck acoustically. :-) You're on your own for the
whole WMA thing, though most of what was said probably applies to the WMA
files and their corresponding streaming mechanism, because MS probably
just stole the ideas from MP3/M3U anyway.

#3. You can also put MULTIPLE .mp3 URLs in a single .m3u file to generate
a "playlist". Way cool.

#4. As always, some browsers (IE) suck worse than others with rich media,
and you will want to force your URL to end in .m3u in the link you provide
so they will do the right thing with your PHP-generated M3U playlist. 
Something like http://example.com/playlist.php/bogus.m3u should do the
trick.  I go even farther, and use .htaccess with ForceType to get Apache
to treat 'playlist.m3u' as a PHP file, so my URL looks like
http://example.com/playlist.m3u so there is NO CHANCE of allowing the
stupid browser to screw up.

#5. Your web server must be configured to know the correct mime-type of
.m3u files.  In the old days, if you (or your host) had altered their
mime-type list in any way, the fresh install of Apache wouldn't update it,
and then they'd maybe have this really old icky list of mime-types which
did not include .m3u.  Fortunately, you could use http://php.net/header to
force the Content-type to be audio/mpeg-url which most browsers "know" is
MP3 playlist.

#6. You can also include #EXTM3U entries with the playlist for some MP3
players to know the artist/album from which the music came.  See URLs
below for example output.

#7. If you want to, you can also use the pretty cool PHP ID3 library to
dynamically pre-pend ID3v2 tags to your MP3s to include copyright, artist
info, and even thumbnail images to go with your MP3s.  I've done that at
http://uncommonground.com with mixed results -- Most players ignore the
extra data, a few display it.  At least none of them seem to choke on
it...  Google for "ID3v2 PHP" and it should turn up.

If anybody has read this far and wants to give me feedback OFF-LIST on the
efficacy of the ID3v2 parts working or not in your player/platform, I'd
sure appreciate it:
http://uncommonground.com
has Hi-Fi and Lo-Fi for your listening pleasure.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux