0 Replies Latest reply on Jun 5, 2013 12:48 PM by DanDinu

    Flex playing mp3 stream doesn't work

    DanDinu

      I've copied the sample code from Adobe for playing an mp3 stream in Flex mobile but it doesn't seem to work.

       

       

      The stream i used as an example works perfectly fine in Winamp.

       

       

      This is my code:

       

       

          import flash.net.*;

              import flash.media.*;

              private  var req:URLRequest;

              private  var context:SoundLoaderContext = new SoundLoaderContext(8000, true);

              private   var s:Sound;

              private  var channel:SoundChannel = new SoundChannel();

       

       

              private  function AudioOn():void

              {

                  req = new URLRequest("http://stream2.srr.ro:8000");

                  s = new Sound(req,context);

                  channel=s.play();              

              }

       

       

                          private function onInit() : void {

                               AudionOn();

                           }

       

       

       

       

      Using the debbuger the s (sound) object has the following state:

       

       

       

       

          s.isBuffering is true;

                 s.isURLInaccesible is false;

                 s.bytesLoaded = 0

                 s.bytesTotal = 0;

       

       

      This seems to be an easy task but why doensn't this example work ?

       

       

      Thanks a lot,

       

       

      Dan