0 Replies Latest reply on Aug 22, 2011 4:31 PM by april_pu_1234

    why we need to call writeFloat twice?

    april_pu_1234

      When we playback the audio recorded, why we need to call  e.data.writeFloat(sample) twice?

       

      private function playRecorded(e:SampleDataEvent): void
                  {
                      if (!rec.bytesAvailable > 0)       
                          return;
                     
                      var length:int = 8192;
                     
                      for (var i:int = 0; i < length; i++)
                         
                      {
                          var sample:Number = 0;   
                          if (rec.bytesAvailable > 0) sample = rec.readFloat();
                          e.data.writeFloat(sample);
                           e.data.writeFloat(sample);   
                      }   
                  }