Or as the developer you can play some silent audio in the background via an `<audio>` element: https://github.com/donbrae/onscreen-piano-keyboard/blob/main.... This will ensure the Web Audio API produces sound even with the ‘silent’ switch active.
Coincidentally someone asked me about this the other day so I put together a minimal demo here in case it's useful to anyone: https://codepen.io/matteason/pen/VYwdzVV
var buffer = dm.audio.createBuffer(1, 1, dm.samplerate); var source = dm.audio.createBufferSource();
source.buffer = buffer; source.connect(dm.audio.destination);
if (source.start) { source.start(0); } else { source.noteOn(0); }
(nice site you created btw! I love seeing audio stuff for the web)