const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); const volume = parseInt((new URLSearchParams(window.location.search)).get('vol')) || 100 $(async function () { const webSocket = window.socket; const announceQueue = []; const playAudio = (src) =>{ return new Promise(resolve =>{ var audio = new Audio(); $(audio).on("loadedmetadata", function() { resolve(audio); }); audio.volume = Math.max(1,Math.min(0,volume/100.0)); audio.src = src; audio.play().catch((err)=>{ if(err.toString().startsWith('NotAllowedError')){ $('body').append($('