                 samplesQueued: samplesQueued()
             };
         }
-        
+
         public function samplesQueued():Number {
-        	return buffer.length / 2;
+            return buffer.length / 2;
         }
-        
+
         public function playbackPosition():Number {
-        	if (this.soundChannel == null) {
-        		return 0;
-        	} else {
-        		return this.soundChannel.position / 1000 - this.fudgeFactor;
-        	}
+            if (this.soundChannel == null) {
+                return 0;
+            } else {
+                return this.soundChannel.position / 1000 - this.fudgeFactor;
+            }
         }
 
         public function soundGenerator(event:SampleDataEvent):void {
             var i:int;
-            
+
             // If we haven't got enough data, write 2048 samples of silence to 
             // both channels, the minimum Flash allows
             if (buffer.length < bufferSize*2) {

    import flash.external.ExternalInterface;
    import flash.media.Sound;
    import flash.media.SoundChannel;
    
    public class dynamicaudio extends Sprite {
        public var bufferSize:Number = 2048; // In samples
        public var sound:Sound = null;

                this.fudgeFactor += (2048 / 44100);
                return;
            }

            var count:Number = Math.min(buffer.length, 16384);

            for (i = 0; i < count; i++) {
                event.data.writeFloat(buffer[i]);
            }

            buffer = buffer.slice(count, buffer.length);
        }
    }
