[Javascript] Intro to the Web Audio API

An introduction to the Web Audio API. In this lesson, we cover creating an audio context and an oscillator node that actually plays a sound in the browser, and different ways to alter that sound.

 

 

 

var context = new window.AudioContext() || new window.webkitAudioContext(),
    osc = context.createOscillator();

osc.frequency.value = 440;
osc.connect(context.destination);
osc.type = "sine";
// uncomment the following line to make noise!
// osc.start();
posted @ 2015-11-11 01:47  Zhentiw  阅读(248)  评论(0编辑  收藏  举报