Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <script type="text/javascript">
  6. console.log("Hello, world");
  7.  
  8. // create web audio api context
  9. var audioCtx = new (window.AudioContext || window.webkitAudioContext)();
  10.  
  11. // create Oscillator node
  12. var oscillator = audioCtx.createOscillator();
  13.  
  14. oscillator.type = 'sine';
  15. oscillator.frequency.setValueAtTime(288, audioCtx.currentTime); // value in hertz
  16. oscillator.connect(audioCtx.destination);
  17. oscillator.start();
  18. setTimeout(()=> {
  19. oscillator.stop()
  20. }, 5000);
  21. </script>
  22. </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement