A simple 440Hz sinewave.
let m = maximilian(); /** * maxiAudio.init() initialises the Audio Context and should execute in a button click event handler to prevent the console warning * "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu" */ let playAudio = () => { let myOsc = new m.maxiOsc(); let maxiAudio = new m.maxiAudio(); maxiAudio.init(); maxiAudio.play = function () { return myOsc.sinewave(440); } } const playButton = document.getElementById('playButton'); playButton.addEventListener("click", () => playAudio());