views:

1075

answers:

2

I am trying to build a flash player for my company's Shoutcast server, and have seen a few articles about it on the 'net, including this SO question here.

However, I can't seem to get the audio stream to actually play. It seems to be connecting alright, but calling stream.play() doesn't seem to do anything.

I have tried the code in the SO question I have linked to, and have also tried something similar to this (sorry i don't remember the exact syntax):

public function stream() {  
    private var url:URLREQUEST = "my.domain.com";
    private var sStream:Sound = new Sound();
    sStream.load(url);
    sStream.play();
}

If anyone has any revelations for me I'd appreciate it.

A: 

Did you try this - (corrected some typos in the code you posted)?

public function stream() 
{  
    private var url:URLRequest = new URLRequest("my.domain.com/song.mp3");
    private var sStream:Sound = new Sound();
    sStream.load(url);
    sStream.play();
}
Amarghosh
well that is the rub...it is a stream, so there is no '.mp3' file.
W_P
and yes, that is what I tried (just didn't have the code in front of me and don't really write actionscript to often
W_P
A: 

I just posted a solution on this thread:

http://stackoverflow.com/questions/1273454/how-to-stream-a-shoutcast-radio-broadcast-in-flash-shoutcast-flash-player

spender
you use sound.loadSound(,), which is AS2. that function does not exist in AS3.
W_P
ok, but the real gold is the semicolon (stream.mp3 is not necessary). looks like you got there in the end.
spender