Re: [PHP] MP3s
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
Re: [PHP] MP3s
Thank you will look at these after the holidays when I get back to the project On Thu, 23 Dec 2004 08:44:20 -0800, Robby Russell [EMAIL PROTECTED] wrote: .m3u does this For example: $ cat the_vacant_-_live_10192004_full_show.m3u http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_01_-_ladders_to_the_moon.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_02_-_rooftop_rocketship.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_03_-_perception.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_04_-_song_1.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_05_-_the_cure_got_in_her_head.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_06_-_red_light.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_07_-_bliss.mp3 Cheers, Robby On Thu, 2004-12-23 at 11:18 -0500, David Dickson wrote: I think if you generate a .m3a file with just the full url of your mp3 and send that to download in the browser this will launch the users mp3 player which will then stream the mp3 that was contained in the file. GH wrote: I appologize in advanced if this is an off topic discussion... 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 Thanks in advance Happy Holidays Gary -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MP3s
I think if you generate a .m3a file with just the full url of your mp3 and send that to download in the browser this will launch the users mp3 player which will then stream the mp3 that was contained in the file. GH wrote: I appologize in advanced if this is an off topic discussion... 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 Thanks in advance Happy Holidays Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MP3s
On Thu, 23 Dec 2004 10:44:32 -0500, GH [EMAIL PROTECTED] 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 I didn't know how either but figured it out in a few minutes using Google. Here's what I did: mp3.html: html head title/title /head body embed src=mp3.m3u autostart=true hidden=true /body /html // mp3.php: ?php $path = /home/destiney/mp3s/Slayer; $file = Seasons In The Abyss.mp3; $file_path = $path/$file; $fp = fopen( $file_path, 'r' ); if( $fp ) { $contents = fread( $fp, filesize( $file_path ) ); fclose( $fp ); } else { die( cannot open file: $file_path ); } header(Content-type: audio/mp3;\r\n); echo $contents; ? // mp3.m3u ( one line ): mp3.php -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MP3s
.m3u does this For example: $ cat the_vacant_-_live_10192004_full_show.m3u http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_01_-_ladders_to_the_moon.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_02_-_rooftop_rocketship.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_03_-_perception.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_04_-_song_1.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_05_-_the_cure_got_in_her_head.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_06_-_red_light.mp3 http://www.thevacant.com/media/live_10192004/160/the_vacant_-_live_10192004_-_07_-_bliss.mp3 Cheers, Robby On Thu, 2004-12-23 at 11:18 -0500, David Dickson wrote: I think if you generate a .m3a file with just the full url of your mp3 and send that to download in the browser this will launch the users mp3 player which will then stream the mp3 that was contained in the file. GH wrote: I appologize in advanced if this is an off topic discussion... 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 Thanks in advance Happy Holidays Gary -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php