title
A prototype
beep
let gain = .3 let pan = 1 // create web audio api context const ctx = new (window.AudioContext || window.webkitAudioContext)(); mainGainNode = ctx.createGain(); mainGainNode.connect(ctx.destination); mainGainNode.gain.value = gain var panNode = ctx.createStereoPanner(); panNode.connect(ctx.destination); function playTone(freq) { let osc = ctx.createOscillator(); osc.connect(mainGainNode); osc.connect(panNode); let type = "sine" osc.frequency.value = freq; panNode.pan.setValueAtTime(pan, ctx.currentTime); osc.start(); osc.stop(ctx.currentTime + 1); return osc; } document.querySelector('button').onclick = function(){ playTone(1000) }
snap
save
new
fork
download
html
css
js
output
gallery
config
➚ link to output
➚ snap player
font size
live reload
snap mode
layout
⤷ switch
★ info and code