Icecast2 PHP Source
Icecast2 PHP Source
I have this PHP code:
I need to create my own souce to interact with icecast2.
<?php
$headers = array(
"Authorization: Basic c291cmNlOmNoYW5nZW1l",
"User-Agent: libshout/2.2.2",
"Content-Type: audio/mpeg",
"ice-name: my name",
"ice-public: 1",
"ice-url: http://www.mydomain.com",
"ice-genre: rock",
"ice-audio-info: bitrate=128;channels=2;samplerate=44100",
"ice-description: This is a stream description"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://main:8000/radio");
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize('some.mp3'));
curl_setopt($ch, CURLOPT_INFILE, fopen('some.mp3', 'rb'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "SOURCE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$b = curl_exec($ch);
echo $b;
curl_close($ch);
?>
This code don't work for me...
Any have a lite code to simulate de source in PHP or C#
Please help me, i need a urgent solution (sorry for pression)
I need to create my own souce to interact with icecast2.
<?php
$headers = array(
"Authorization: Basic c291cmNlOmNoYW5nZW1l",
"User-Agent: libshout/2.2.2",
"Content-Type: audio/mpeg",
"ice-name: my name",
"ice-public: 1",
"ice-url: http://www.mydomain.com",
"ice-genre: rock",
"ice-audio-info: bitrate=128;channels=2;samplerate=44100",
"ice-description: This is a stream description"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://main:8000/radio");
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_UPLOAD, 1);
curl_setopt($ch, CURLOPT_INFILESIZE, filesize('some.mp3'));
curl_setopt($ch, CURLOPT_INFILE, fopen('some.mp3', 'rb'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "SOURCE");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$b = curl_exec($ch);
echo $b;
curl_close($ch);
?>
This code don't work for me...
Any have a lite code to simulate de source in PHP or C#
Please help me, i need a urgent solution (sorry for pression)
- Jay
- Will work for food (Administrator)
- Posts: 3013
- Joined: Mon Jan 14, 2002 12:48 am
- Location: Next Door
- Contact:
Re: Icecast2 PHP Source
Any particular reason for using curl? Icecast requires a SOURCE request, not sure if that is possible in curl.
- Jay
Re: Icecast2 PHP Source
if possible give me an example in any language
I don't see any code on internet...
thank's for your help and atencion..
I don't see any code on internet...
thank's for your help and atencion..
Re: Icecast2 PHP Source
I need a port for C# to streaming using C# player..
But i need to understand how protocol works...
Thank's a lot..
But i need to understand how protocol works...
Thank's a lot..