17 lines
898 B
Plaintext
17 lines
898 B
Plaintext
updateCount();
|
|
|
|
// ── Ding on open ─────────────────────────────────────────────────────
|
|
try {{
|
|
const ctx = new (window.AudioContext || window.webkitAudioContext)();
|
|
const osc = ctx.createOscillator();
|
|
const gain = ctx.createGain();
|
|
osc.connect(gain); gain.connect(ctx.destination);
|
|
osc.type = 'sine';
|
|
osc.frequency.setValueAtTime(880, ctx.currentTime);
|
|
osc.frequency.exponentialRampToValueAtTime(440, ctx.currentTime + 0.15);
|
|
gain.gain.setValueAtTime(0.35, ctx.currentTime);
|
|
gain.gain.exponentialRampToValueAtTime(0.001, ctx.currentTime + 0.4);
|
|
osc.start(ctx.currentTime);
|
|
osc.stop(ctx.currentTime + 0.4);
|
|
}} catch(e) {{}}
|