1

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

2
  • Are you sure this question should be tagged with Flex? You seem to be using ActionScript classes; but not Flex classes. Jun 5, 2013 at 19:07
  • @Reboog711 I'm using Flex to build my mobile application. This is the sample from Adobe's site for audio streaming
    – Dan Dinu
    Jun 5, 2013 at 19:11

1 Answer 1

0

Have you ever tried to modified your sound file by

  1. Remove all metadata in the sound file.
  2. Export it to a new MP3 file.
  3. Is it too large to load? Try to add error event to listen.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.