My stream people said they could see no reason why this doesnt work

@Admin Admin I dont see any point of having an argument. I could provide email from Fri, Dec 16, 4:47 AM by Lee Johnston of Wildcard Net:, but that wont solve anything as we moved past it at that time . I am trying to focus on a better way forward that works with my stream no recording any data other than sql certainly not producing i/o which is now restricted. I was informed to get an IDE I hope Visual Studio is what was meant?

@Oxy Also I loaded the files into Studio and it said it had no issues or errors but get this

Parse error: syntax error, unexpected ‘->’ (T_OBJECT_OPERATOR) in /home/vol1_2/epizy.com/epiz_33087480/htdocs/stream/lib/stream.php on line 183

it seems to be stopping here
[183] if(substr($tag,0,3) == “id3” ) {
[184] if(substr($tag,4,6) == “v22”) {
[185] )
[186] } else if(substr($tag,4,6) == “v23”){
[187]
[188] }
[189]
[190] }

Sigh gives up going to HTTPs cant understand this code it only seems to step through 8192 chunk not even reading headers. This said if its dumping this all why does it not play ? Is it missing the headers on each 8192 bytes?

$url = "http://".$server.":".$port."/".$mount;


class MetadataBlock {
    private $expected_length, $content;
    public $ID3 =  array(
    "ID3" => array(BinaryFileReader::FIXED, 3),
    "Version" => array(BinaryFileReader::FIXED, 2),
    "Flag" => array(BinaryFileReader::FIXED, 1),
    "SizeTag" => array(BinaryFileReader::FIXED, 4, BinaryFileReader::INT)
    );
    public $ARTMAP =  array(
    "TextEncoding" => array(BinaryFileReader::FIXED, 1),
    "MimeType" => array(BinaryFileReader::NULL_TERMINATED),
    "FileName" => array(BinaryFileReader::NULL_TERMINATED),
    "ContentDesc" => array(BinaryFileReader::NULL_TERMINATED),
    "BinaryData" => array(BinaryFileReader::EOF_TERMINATED)
    );
    public $ALLTAGS =  array(
    "FrameID" => array(BinaryFileReader::FIXED, 4),
    "Size" => array(BinaryFileReader::FIXED, 4, BinaryFileReader::INT),
    "Flag" => array(BinaryFileReader::FIXED, 2),
    "Body" => array(BinaryFileReader::SIZE_OF, "Size"),
    );

    private $id3v23 = array("TIT2","TALB","TPE1","TRCK","TDRC","TLEN","USLT");
    private $id3v22 = array("TT2","TAL","TP1","TRK","TYE","TLE","ULT");
    
   /**
     * Creates a new empty MetadataBlock with the given $expected_length.
     * The actual content can be added using the write() method.
     */
    public function __construct($expected_length) {
      $this->content = '';
      $this->expected_length = $expected_length;
    }

    public function expected_length() {
      return $this->expected_length;
    }

    public function write($buffer) {
      $this->content .= $buffer;
    }

    public function content() {
      return $this->content;
    }

    public function length() {
      return strlen($this->content);
    }

    /**
     * Determines if the metadata block is complete. A metadata block is completed
     * when its content has at least $expected_length bytes of data.
     * https://learn.microsoft.com/en-us/windows/win32/wmformat/id3-tag-support
     */
    public function is_complete() {
      return $this->remaining_length() == 0;
    }

    public function remaining_length() {
      return $this->expected_length - $this->length();
    }
    public function stream_title() {
      if (!$this->is_complete())
        throw new \Exception("The Title is not complete yet");
      $start = strlen("TIT1"); // title
      $end = strpos($this->content, "TIT1", $start);
      return substr($this->content, $start, $end-$start);
    }public function stream_author() {
      if (!$this->is_complete())
        throw new \Exception("The Authur is not complete yet");
      $start = strlen("TPE2"); //Author
      $end = strpos($this->content, "TPE2", $start);
      return substr($this->content, $start, $end-$start);
    }
    public function stream_album() {
      if (!$this->is_complete())
        throw new \Exception("The Album is not complete yet");
      $start = strlen("TALB");      // The structure of the TALB (Album) text frame
      $end = strpos($this->content, "TALB", $start);
      return substr($this->content, $start, $end-$start);
    }
    public function stream_genre() {
      if (!$this->is_complete())
        throw new \Exception("The Genre is not complete yet");
      $start = strlen("TCON");      // Genre 
      $end = strpos($this->content, "TCON", $start);
      return substr($this->content, $start, $end-$start);
    }
    public function stream_comment() {
      if (!$this->is_complete())
        throw new \Exception("The comment is not complete yet");
      $start = strlen("TCOM");      // Comment
      $end = strpos($this->content, "TCOM", $start);
      return substr($this->content, $start, $end-$start);
    }
    public function stream_year() {
      if (!$this->is_complete())
        throw new \Exception("The comment is not complete yet");
      $start = strlen("TYER");       // Year
      $end = strpos($this->content, "TYER", $start);
      return substr($this->content, $start, $end-$start);
    }  
    public function stream_duration() {
      if (!$this->is_complete())
        throw new \Exception("The duration is not complete yet");
      $start = strlen("TLEN");       // Duration
      $end = strpos($this->content, "TLEN", $start);
      return substr($this->content, $start, $end-$start);
    } 
    public function stream_bpm() {
      if (!$this->is_complete())
        throw new \Exception("The bpm is not complete yet");
      $start = strlen("TBPM");      // Beats per Minute.
      $end = strpos($this->content, "TBPM", $start);
      return substr($this->content, $start, $end-$start);
    }
    public function stream_listeners() {
      if (!$this->is_complete())
        throw new \Exception("The listeners is not complete yet");
      $start = strlen("LISTENERS=");
      $end = strpos($this->content, ";", $start);
      return substr($this->content, $start, $end-$start);
    } 
    public function stream_song_cover() {
         $start = strlen("APIC");
         $end = strpos($this->content, "APIC", $start);
         return substr($this->content, $start, $end-$start);
    }

    public function stream_lyrics() {

         $start = strlen("USLT");
         $end = strpos($this->content, ";", $start);
         return substr($this->content, $start, $end-$start);
    }
}

// Begin SHOUTcast Principle control
class stream {
    private $metadata, $next_metadata_position, $icy_metaint, $mp3, $stream_bytes_count = 0;
    private $length,$duration,$tag;
    private $expected_length, $content;
    private $options, $default_options = array(
      'path'               => '.',
      'split_tracks'       => false,
      'max_track_duration' => 3600, #sec (1 h)
      'max_track_length'   => 102400000 #bytes (100 mb)
    );
    public $title;
    public function __construct($options=array()) {
      $this->options = array_merge($this->default_options, $options);
    }

    public function start($url) {
      $http_streaming = new HttpStreaming($url);
      
      $http_streaming->open();
      $response_message = $http_streaming->response_message();
      var_dump($response_message);
      $this->icy_metaint = $response_message->icy_metaint();
     
      $this->next_metadata_position = $this->icy_metaint; //8192 value lenghth of frames
      
           
      while ($buffer = $http_streaming->read_stream()) {
        $this->length += strlen($buffer);
        if (!$this->process_received_buffer($buffer) || $this->are_limits_reached()) break;
      }
    }

    private function are_limits_reached(){
        //return false;
        return  $this->length >= $this->options['max_track_duration'];
    }
    private function process_received_buffer($buffer) {
      $buffer_len = strlen($buffer);
      $this->stream_bytes_count += $buffer_len;
      var_dump( $buffer);
      return TRUE;

    }
}

?>

Also what does this represent as i cant make any head or tail of it the axis make no sense

Out of all the IDEs, you chose the biggest one (unless it is VS Code)
listen, it’s a tool to help you
and you must know that it is not so smart that it fully understands your program and that it automatically knows what is defined in another file, etc.
so don’t pay attention to everything it tells you,
use common sense and of course, you will gain some experience over the years
so you will better understand if there is a problem or not.

If nothing else, you won’t have problems with unclosed brackets or quotes and other things you often did in your php/js code.

6 Likes

Well the graph looks wrong i have not used the site since suspension until today it shows reading for tomorrow which has not happened yet

Well i am not using it at present as scared too as it will just suspend me again and it makes no sense the graph as it doesn’t even show accurate data after suspensions. I cant get this thing to work at all restreaming or even reading the id3 codes i think the code i had runs through 8192 bytes but it must strip something out as even if i tell website it can use data as a stream it doesn’t i presume you read first stuff upto 8192 which is my sysytem took down

Hi, what to say.
This is my secondary account.

I’m sorry for doing mistake and get banned.
So, i can’t see anything to the forum, from my previous account.
So what i missed You can tell me, right?

I have a question, why your stream don’t have voice. I think we had a great job.

i was found it working.
You better echo or vardump on write_buffer function like this

public function write_buffer($buffer, $start=0, $len=null) {
      $buffer = $len ? substr($buffer, $start, $len) : substr($buffer, $start);
      //fwrite($this->handle, $buffer);
      //$this->length += strlen($buffer);
      
      echo $buffer;
    }

it won’t write to the file.
So when you when You put your code to for example getStream.php You will get the mp3 stream data clean without metadata. don’t write/echo header to make it stream page. If write header it will download it instead of streaming it.

Thanks but am getting this at present on file manager

Have You clear cache

Yes did what you suggested https://www.deniserose.epizy.com/stream/ no sound
while ($buffer = $http_streaming->read_stream()) {
$this->length += strlen($buffer);
var_dump($buffer);
//if (!$this->process_received_buffer($buffer) || $this->are_limits_reached()) break;
}

FTP connection is offline too

Error: Could not connect to server
Status: Waiting to retry…
Status: Resolving address of ftpupload.net
Status: Connecting to 185.27.134.11:21…
Error: Connection timed out after 20 seconds of inactivity
Error: Could not connect to server

Omg guys, Im back to being poor since yrs and testing out free webhosters atm. The first forum post i stumbled upon here was this- I wish I had popcorn here, lel!

Denise, if I will be able to farm some money back after launching my projects, I promise to gift you an infinityfree premium acc, bcs this convo was just too hilarious!

Hey, sometimes a lot can suck, me eg reached the w3school limit, bcs I wasn’t careful enough. But since u code directly on their server, it seems like they kidnapped my work til the 22nd March or if I pay for it, lol. Cannot even download nor look at the files and was working for over 12 hrs straight cx
If I will survive it, you can also make it through these 10hrs Denise, u go girl <3!

And amazing calm support here, me like.
Let’s see, I’m pretty sure I will reach the limit also soon, need to implement a lot of graphics. Your advertisement is rly a little misleading tbh, but I better try first before complaining. Will be a good training and it’s free for us, don’t forget that’s a pretty cool thing {^-^}*

Hf guys and stay calm! One coder family, one love <3

Well I tried all this and it didn’t work at all for me am so fed up i dont think any of this works so i am better cooking and cleaning up as none of this stuff is any good

Hugs D
lib\audio_file.php (2.5 KB)
lib\http_reponse_message.php (2.9 KB)
lib\http_request_message.php (866 Bytes)
lib\http_streaming.php (2.8 KB)
lib\stream.php (9.3 KB)
index.php (3.3 KB)

Don’t think anything complicated works on this site you seemed to have crippled the ftp editing with ridiculous errors coming up in the middle of editing


and

Perhaps if you stop fiddling with this it would work better ?

Here we go again
Account Temporarily Suspended

Your free hosting account is suspended for reaching a daily resource limit. Please note that each free hosting account has daily CPU, hits, RAM, I/O, and Entry process limits. During each day we record all of these usage stats. It is quite normal for a website to utilise daily limits as PHP scripts do use alot of server resources, especially if you have multiple PHP scripts and websites in your free hosting account.

The daily limit you reached was your daily io limit.

When will your free hosting account be re-activated?

Your free hosting account will be automatically reactivated 24 hours after it was suspended.

Therefore at 16:02 Thursday 23 February (in 23 hours, 50 minutes) your account will be activated again where you will regain full access!)

Once your account is activated you may want to consider lowering your server resource usage by removing scripts, plugins, domains, optimizing your code, install caching, or upgrading your free account to our premium hosting which has upto 80 times the limits of a free hosting plan with 100’s of extra features.


So how can this be the case when i have barely played eighteen songs that is six teen i/o requests .

I explained to you this morning you graphs were completely off as you did not even show that my account was suspended for two days now this is becoming redicculous where is this no IO on the day on your graph ? Furthermore why is it already rising on day 23 > when we have not even got to that day yet. This is madness

Am I to understand your threshold is now set to 18 I/O transfers? or as it appears your services control out of control as it seems and you are just firefighting problems which you are making the whole service you operate unstable? Is anyone else seeing this or is this just directed at my website and me?