Radio Toolbox
Radio Toolbox
Radio Toolbox
Radio Toolbox
Menu
Search
Page Options
Sponsored Links
  
Forums - View topic - Icecast2 PHP Source
   
It is currently Sat Jul 26, 2014 10:09 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Icecast2 PHP Source
PostPosted: Tue Oct 05, 2010 5:42 pm 
Offline

Joined: Tue Oct 05, 2010 5:36 pm
Posts: 3
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)


Top
 Profile  
 
 Post subject: Re: Icecast2 PHP Source
PostPosted: Wed Oct 06, 2010 5:29 am 
Offline
Will work for food (Administrator)
User avatar

Joined: Mon Jan 14, 2002 1:48 am
Posts: 2634
Location: Next Door
Any particular reason for using curl? Icecast requires a SOURCE request, not sure if that is possible in curl.

_________________
- Jay


Top
 Profile  
 
 Post subject: Re: Icecast2 PHP Source
PostPosted: Wed Oct 06, 2010 5:49 am 
Offline

Joined: Tue Oct 05, 2010 5:36 pm
Posts: 3
if possible give me an example in any language

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

thank's for your help and atencion..


Top
 Profile  
 
 Post subject: Re: Icecast2 PHP Source
PostPosted: Wed Oct 06, 2010 9:58 am 
Offline

Joined: Tue Oct 05, 2010 5:36 pm
Posts: 3
I need a port for C# to streaming using C# player..

But i need to understand how protocol works...

Thank's a lot..


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group