title: How to synthesize exact frequencies on flash?
body: <p>I've researched a bit and I discovered a way to generate sounds dynamically on flash:</p>
  
  <pre><code>import flash.media.Sound;
  
  var mySound:Sound = new Sound();
  
  mySound.addEventListener(SampleDataEvent.SAMPLE_DATA, sineGenerateSound);
  
  mySound.play();
  
  function sineGenerateSound(event:SampleDataEvent):void{ 
  
   for(var i:int=0;i&lt;4092;i++){  
  
    var n:Number = Math.sin((i+event.position)/Math.PI/4); 
    event.data.writeFloat(n)
    event.data.writeFloat(n)
   } 
  }
  </code></pre>
  
  <p>I would just like to know <strong>how I can make it generate the exact frequency I need</strong>, for example 100Hz.</p>
  
  <p>Thanks!</p>