[Javascript] Intro to the Web Audio API

时间:2022-03-24 20:11:10

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.

[Javascript] Intro to the Web Audio API

[Javascript] Intro to the Web Audio API

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();