rewolf
rewolf

Reputation: 5871

Playing an mp3 live stream with Flash/Actionscript

I'm completely new to ActionScript and Flash. I need to create a flash plugin that can play audio that is streaming live in an mp3 format. I would have used the new html5 <audio> tag except that they don't support mp3, and I have thus resorted to Flash.

I have managed to play remote mp3 files and local files, but am struggling to get the following to work with streaming data:

var req:URLRequest = new URLRequest("http://ip:port");
var s:Sound = new Sound(req);
fl_SC = s.play();

I have a feeling it's because it's not just a simple URL request.. How would one accomplish such a task?

Upvotes: 1

Views: 2050

Answers (1)

John Giotta
John Giotta

Reputation: 16944

Pass the URLRequest object to a Sound.load method.

var req:URLRequest = new URLRequest("http://ip:port");
var s:Sound = new Sound();
s.load(req);
fl_SC = s.play();

Upvotes: 1

Related Questions