title: javascript generate square wave sound
body: <p>I want to generate a square wave sound using a signal "1 0 0 0". Each code (0,1) has a pattern as shown in <a href="https://drive.google.com/file/d/0ByfrAMlECtveNUF5RjlsTWtsUjQ/view?usp=sharing" rel="nofollow">picture</a>.</p>
  
  <p>For example, code 1 will produce a sound for 500µs and than stops for 1000µs.The signals should go from zero to maximum positive amplitude and will not have any negative amplitude.The frequency of the sound is 10KHz.</p>
  
  <p>Basically i need to generate this sound from mobile devices (iPhone, Android and Windows phone 8). I am using Cordova framework. Any suggestions?</p>