title: How to play notification sound on website since google autoplay policy change
body: <p>I've been trying to short beep for a notification on website but google autoplay policy change does not allow me to do so what should I do. I've seen so many sites still doing this like facebook chat etc.</p>
  
  <p>I've tried this with no success (also tried with  element):</p>
  
  <pre><code>function beep(vol, freq, duration){
  v=a.createOscillator()
  u=a.createGain()
  v.connect(u)
  v.frequency.value=freq
  v.type="square"
  u.connect(a.destination)
  u.gain.value=vol*0.01
  v.start(a.currentTime)
  v.stop(a.currentTime+duration*0.001);
  }
  beep(vol, freq, duration);
  </code></pre>