Hey hows it going. quick question...

Currently I have it so users can log in and upload MP3s, but I only have them avaible for download to surfers. I want them to be able to stream in LO-FI and HI-FI and also track the number of plays. If someone could get back to me on this w/ a time frame and price,I would greatly apprecaite it.

an example of what I am talking about is here
http://www.soundclick.com/pro/?BandID=122577

you can see they have "lo fi" "hi fi" "download"

Thanks

    The cool thing about streaming MP3 is that its not even a different format. All you have to due is place the address of the MP3 in a .m3u file (which can be done automatically by PHP), and when the player downloads this small text file it'll start downloading the mp3 it points to, and play it as soon as it has enough buffered.

    It is technically streaming the MP3, but its just the same exact MP3 that your surfers would be downloading, and plays the same as if it was on their hard drive (if their connection is fast enough). The only difference in your case is that you will need a low bit rate version of each MP3 for your lo-fi link, and have the lo-fi m3u file point to the lo-fi mp3 file. The M3U's can easily be made on the fly by PHP, but even the lo-fi MP3's take a little bit to encode so those will need to be made ahead of time.

    If you need any more help with this let me know.

      thanks bro.....I just emailed you.

      is there a way the lo-fi mp3s can be created through PHP so all the work is done automatically?

        I would suggest using the command-line version of the LAME MP3 encoder. You can have your script tell if the lo-fi version of an MP3 exists, and if not, run LAME with the right parameters to convert the hi-fi version to lo-fi. Instead of having the script called when someone wants the lo-fi version, if it's run every time a new MP3 is uploaded, or every X minutes (and only makes lo-fi MP3s when needed), there should be minimal wait for the users.

        I've done a whole lot of PHP/MP3 coding (I'm listening to streaming MP3s through my php code as we speak 🙂), and you can do almost anything with them. I stream MP3s off my ipod and across our network at work, and a bunch of other stuff. it's great 🙂

          I used this for a site i helped make, this is the m3u make

          <?
          header("Content-type: audio/x-mpegurl");
          $file = $_REQUEST["file"];
          $file = ereg_replace("[[:space:]]", "%20", $file);
          print ($file);
          ?>
          

          and this is part of the file listing used to sort out the hi-fi and lo-fi files it was setup so that they uploaded "songname.mp3" and "songname (lofi).mp3"

          if(!is_dir($path)) {
          	$no = "This band has not uploaded any samples";
          }
          else{
          	chdir($path);
          	$cur_dir = opendir($path) or die ("Unable to open your folder. Please contact the Admin");
          	while(false !== ($file = readdir($cur_dir))) {
          		if ($file != "." && $file != ".." && eregi("(lofi)", $file) != TRUE) {
          			$files[] = $file;
          		}
          		else if ($file != "." && $file != "..") {
          			$lofifiles[] = $file;
          		}
          	}
          	closedir($cur_dir);
          	if($files == NULL) {
          		$no = "This band has not uploaded any samples";
          	}
          

          hope this helps

            Write a Reply...