Loldongs Posted May 13, 2008 Share Posted May 13, 2008 Hey guys, <?php ini_set('memory_limit', '3000M'); $fp = fsockopen("127.0.0.1", 8001, $errno, $errstr, 30); if (!$fp) { die('Cannot connect'); } $headers .= '*** icy-name:Dean PHP icy-genre:Episodes icy-metadata:1 icy-pub:0 icy-url: Google.com icy-irc: irc.google.com icy-icq: 123123 icy-aim: LOL content-type:video/nsv icy-br:128 icy-reset:1\n '; fwrite($fp, $headers); while (!feof($fp)) { echo fgets($fp, 128); } $filename = "FILE.nsv"; $handle = fopen($filename, "r"); $contents = fread($handle, filesize($filename)); fclose($handle); fwrite($fp, $contents); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); ?> Basically above im sending a NSV file to a shoutcast stream but as you can see there is no limits on how fast it sends to the server. Is there anyway i can split the file into parts and send them slowly or a way to set how many kb/s to send the file at Quote Link to comment Share on other sites More sharing options...
mraiur Posted May 13, 2008 Share Posted May 13, 2008 hmmm why dont you just set max_execution_time ? And left it no mather how long it takes to upload ... Quote Link to comment Share on other sites More sharing options...
Loldongs Posted May 13, 2008 Author Share Posted May 13, 2008 The problem is i want it to take time to upload it needs to upload about 1 megabyte a minuite to keep the stream in sync Quote Link to comment Share on other sites More sharing options...
Fadion Posted May 13, 2008 Share Posted May 13, 2008 Take a look at this tutorial, maybe it helps. Quote Link to comment Share on other sites More sharing options...
Loldongs Posted May 14, 2008 Author Share Posted May 14, 2008 Thanks thats exactly what i was after Quote Link to comment Share on other sites More sharing options...
severndigital Posted May 14, 2008 Share Posted May 14, 2008 please mark topics solved if you've completed. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.