Home Page

  • August 03, 2020, 01:37:58 PM *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  


Official site launch very soon, hurrah!

Post reply

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Message icon:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:
Sorry, but I've had to disable commenting at this time. There has only been spam for a while.:

shortcuts: hit alt+s to submit/post or alt+p to preview

Topic Summary

Posted by: Dakusan
« on: June 16, 2010, 08:25:29 PM »

Sounds good. From what you said, I guess you have everything you were going to ask me resolved. If you have any other questions, don't hesitate to ask :-).
Posted by: Dakusan_RestorePosts
« on: June 16, 2010, 11:04:00 AM »

[Posted by unknown user]

It seems that your solution works great with audio/mpeg.
With aac+ transmission i am able to transmit to winamp but not to flash(Got to change the content type to do this).
I googled and it seems that flash requires an mpeg4 container for the aac+ data... [Rest of text lost]
Posted by: Dakusan_RestorePosts
« on: June 16, 2010, 11:02:00 AM »

[Posted by unknown user]

The URL from the second got with a dot just remove it

Posted by: Dakusan_RestorePosts
« on: June 16, 2010, 11:00:00 AM »

[Posted by unknown user]

Hello i sent an e-mail to you earlier.
By that time i could not make this work.
By now i think flash is pure and simple VOODOO!

I could not play from the php prior (for unknown reasons) here is the PHP script: http://pastebin.com/Sgm9Hx75

Now i can.
Bu... [Rest of text lost]
Posted by: Dakusan
« on: March 21, 2010, 04:15:23 PM »

A client of mine wanted their website to have an applet that played streaming music from a SHOUTcast server. The easy solution would have been to just embed a Windows Media Player applet into the page, but that would only work for IE.

I thoroughly searched the web and was unable to find a Flash applet (or other solution) that already did this (and actually worked). Most of the information I was finding was people having problems getting this kind of thing working in Flash with no answer provided. After giving up on finding a resolution online, I decided to load up Flash and see what I could find from some tinkering.

Quite frankly, I’m shocked people were having so many problems with this. I started an ActionScript 2.0 project and put in the following code, and it worked right away in Flash CS3 (v9.0) with no problem:

var URL="http://example.shoutcast.castledragmire.com:1234/" //The URL to the SHOUTcast server
var MySound:Sound=new Sound(this);

Unfortunately, once I exported the Flash applet and loaded it up in my browsers, it was no longer working. After a few minutes of poking around, I had a hunch that the SHOUTcast host might be sending different data depending on the [Browser’s] User Agent. I changed Firefox’s User Agent to “Flash” through a Firefox add-on (User Agent Switcher), and it worked :-D.

Once again, unfortunately, this was not a viable solution because I couldn’t have every user who visited the client’s web page change their browser User Agent string :-). The quickest solution at this point to the problem was to just create a passthrough script that grabbed the live stream on their server and passed it to the client. The following is the PHP script I used for this:

$port      ='1234';
$path      ='/';

header('Content-type: audio/mpeg');
fputs($sock, "GET $path HTTP/1.0\r\n");
fputs($sock, "Host: $streamname\r\n");
fputs($sock, "User-Agent: WinampMPEG/2.8\r\n");
fputs($sock, "Accept: */*\r\n");
fputs($sock, "Connection: close\r\n\r\n");

The final two steps to get this working were:
  1. Setting the Flash Applet’s URL variable to the PHP file
  2. Turning off PHP output buffering for the file. This can only be done through Apache or the php.ini depending on the server setup. This is very important, as if it’s on, the data will never get sent to the user.

The only problem with this method is that it taxes the server that is passing the data through, especially since it uses PHP... This kind of thing could very easily be done in C though (as a matter of fact, I will be writing a post on something very close to that very soon).