AudioInstance = () => {
let _a = new Audio();
_a.addEventListener(
'loadeddata',
() => (mutable state = md`the audio is loaded`)
);
_a.addEventListener(
'playing',
() => (mutable state = md`the audio is playing`)
);
_a.addEventListener(
'ended',
() => (mutable state = md`the audio has finished playing`)
);
_a.playAudio = _url => {
_a.setAttribute('src', _url);
_a.setAttribute('src', _url);
_a.load();
_a.play();
};
return _a;
}