0 Replies Latest reply on Oct 21, 2009 6:22 PM by Satrianix

    Problem with Radio Streaming with SHOUTcast

    Satrianix

      Hi overyone, I don't speak english, but I hope you understand

       

      I have an audio player, which connects to a SHOUTcast server.

       

      Everything works fine, the player connects, and begins to download the audio, and plays, but after 1 or 2 minutes, loading the audio is cut, and no longer continuing.

       

      I leave my code a bit ..

       

       

      private var _urlStream:String = 'http://69.162.119.226:8022/;stream.nsa';

       

      //==========================

      private var _soundStream:Sound;

      private var _soundChannel:SoundChannel;

      private var _soundTransform:SoundTransform;

       

      //==========================

       

      private function initHandler():void

      {

           _soundChannel = new SoundChannel();

            _soundTransform = new SoundTransform();

       

      }

       

      private function playSoundStream(value:MouseEvent=null):void

      {

        

       

       

           _soundStream = new Sound();

           addSoundListeners(); // I add the listeners of the Sound class

       

           var _stream:URLRequest = new URLRequest(_urlStream);

           _soundStream.load(_stream);

       

      }

       

      private function stopSoundStream(value:MouseEvent):void

      {

           playButton.enabled = true;

           removeSoundListeners();

           _soundChannel.stop();

           _soundChannel.removeEventListener(Event.SOUND_COMPLETE, soundCompleteHandler);

           _soundStream.close();

       

      }

       

       

       

       

      /**=======================================================

      * ================Gestion de Eventos ====================

      *=======================================================*/

      private function openHandler(value:Event):void

      {

           _soundChannel = _soundStream.play();

       

      }

       

      private function progressHandler(value:ProgressEvent):void

      {

           var bytes:Number = _soundStream.bytesLoaded;

           var kilobytes:Number = Math.floor(bytes / 1024);

       

       

       

           trace('[BL] ' +Math.floor(kilobytes/1024) + ' MB     [SM] '+Math.floor((System.totalMemory/1024))+' KB');

      }