Results 1 to 5 of 5

Thread: mp3 streaming

  1. #1
    Join Date
    May 2002
    Location
    Deltona, FL
    Posts
    9

    mp3 streaming

    been trying to work on a streaming application to simply allow users to select a file (will be a *.mp3) and have it play to winamp or another registered mp3 player.

    Have the working search/location parts, but when I pass the filename of the mp3 to play, via http header, i only get winamp to display, and play the intro to winamp. Any idea what I am missing? Tried looking around for more information, but can't really seem to find anything that will give me a clue as to where I need to go from here...

    Here is the code snippet that I am trying to use to pass the absolute url of the file to a new page and kick off the winamp session to play the mp3, but...as i said, all I get is the error in winamp. If you need to see more code, let me know, but I think that this is the problem, so...

    $loc = str_replace(" ", "%20",$loc);
    Header("Content-Type: audio/x-mpegurl");
    echo $loc . "\n";

    Thanks in advance for any help!

    Patrick
    Patrick Hartnett
    http://www.e-dbapps.com
    patrick@e-dbapps.com

  2. #2
    Join Date
    Nov 2001
    Posts
    174
    If you want the browser to launch the MP3-associated program/plugin (like clicking on a link to an MP3) try:

    header("Location: http://www.server.com/song.mp3");

    or in your case:

    header("Location: " . $loc);

    The problem with this is that it seems to need to download the MP3 before it can be played.
    If I figure out a way to make it stream and not download (like mp3.com) I'll let you know.
    //Jhawk//

  3. #3
    Join Date
    May 2002
    Location
    Deltona, FL
    Posts
    9

    Talking A step closer...

    Thanks jhawk. I noticed that streaming an mp3 doesn't really seem to be somethin many people have 'openly' discussed in the groups and various code places, but your help is more than I have found on the subject all day.

    I'll also let you know if I find anything else out on the streaming side. My hope is, it isn't going to involve running some mp3 server app, or making something that complex. I just want to toy with something simple, and maybe, in the future, build off of it.

    either way, 'preciate the help

    -Patrick
    Patrick Hartnett
    http://www.e-dbapps.com
    patrick@e-dbapps.com

  4. #4
    Join Date
    Nov 2001
    Posts
    174
    You don't need a special server to stream a single MP3. In Winamp hit ctrl-L and add a URL to an MP3. Even if the MP3 is on a regular http server, it will stream.

    One idea would be to make a .m3u or .pls playlist that refers to the URL of the actual MP3. That way your would only have to download a very small playlist file instead of the whole MP3. I think mp3.com uses something like that.
    //Jhawk//

  5. #5
    Join Date
    Apr 2002
    Posts
    136
    i like that feature in winamp is quite good

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •