0 Replies Latest reply on Jun 19, 2009 8:44 AM by The tinkerer

    Strange Error: Flex AS3 - Using Sound class

    The tinkerer

      Evenin, mates.


      My situation is the following...
      I am trying to use Sound class to access a stream on different servers.
      Think playing Shoutcast streams from a web page.
      My "play" code is the following:


      soundPlayback = new Sound(new URLRequest(soundURL), soundContext);

      soundPlayback.addEventListener(IOErrorEvent.IO_ERROR,   sound_Error,false,0,true);

      soundPlayback.addEventListener(ProgressEvent.PROGRESS,   sound_Progress,false,0,true);

      soundChannel = soundPlayback.play();

      soundChannel.soundTransform = soundTransformer;


      I actually have a class, it would be a little too lengthly to copy-paste the entire thing, but I will if it gets to it.
      This is not the first time I've made a player like this and this is not the first time I've used my class...
      This issue I see for the first time, however.


      The issue:
      I originally load a PLS file, extract play links out of it and then pass it into my play class as "soundURL".
      My sound_Progress catches initiation and shows buffer going. Buffer loads and... well that's it... nothing happens. No sound, no error, no warning, no status. Nothing. If I try to call Sound.close(), I get an error that no stream is connected: "Error #2029: This URLStream object does not have a stream opened". Its like everything stops mid way.
      I've tried to just give it time, since Firefox tells me "Connecting [insert ip/url of the stream here]", but then it stops as well.


      What I've noticed that is strange, the buffer is very small: 4927 bytes, as reported by the sound_Progress.


      An example PLS url is:

      Example sound stream is:



      I thought it could be an issue with permissions, but would I even get a buffer?


      I am using AS3 in Flex to code and FireFox 3 to test.


      Any input is greatly appreciated.