Public
Edited
Mar 3, 2024
Insert cell
Insert cell
Insert cell
ctx = new window.AudioContext();
Insert cell
Insert cell
function playTone({ frequency, duration }) {
if (ctx.state == "suspended") {
ctx.resume();
}
const osc = ctx.createOscillator();
osc.frequency.setValueAtTime(frequency, ctx.currentTime);
osc.connect(ctx.destination);
osc.start(ctx.currentTime);
osc.stop(ctx.currentTime + duration);
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more