Icecast2 PHP Source

Talk about Audio On Demand or Streaming
diogopms
Posts: 3
Joined: Tue Oct 05, 2010 5:36 pm

Icecast2 PHP Source

Postby diogopms » Tue Oct 05, 2010 5:42 pm

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)

User avatar
Jay
Will work for food (Administrator)
Posts: 2761
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Icecast2 PHP Source

Postby Jay » Wed Oct 06, 2010 5:29 am

Any particular reason for using curl? Icecast requires a SOURCE request, not sure if that is possible in curl.
- Jay

diogopms
Posts: 3
Joined: Tue Oct 05, 2010 5:36 pm

Re: Icecast2 PHP Source

Postby diogopms » Wed Oct 06, 2010 5:49 am

if possible give me an example in any language

I don't see any code on internet...

thank's for your help and atencion..

diogopms
Posts: 3
Joined: Tue Oct 05, 2010 5:36 pm

Re: Icecast2 PHP Source

Postby diogopms » Wed Oct 06, 2010 9:58 am

I need a port for C# to streaming using C# player..

But i need to understand how protocol works...

Thank's a lot..


Return to “Audio Streaming”

Who is online

Users browsing this forum: No registered users and 1 guest