To create an Audio object, I simply do this:
let myAudio = new Audio("myAudio.ogg")
But what if I have multiple sources? In HTML I can do this:
<audio id="myAudio">
<source src="myAudio.ogg" type="audio/ogg" />
<source src="myAudio.mp3" type="audio/mpeg" />
</audio>
<script>
let myAudio = document.getElementById("myAudio")
</script>
But I don't want to use an HTML block. Is there a way to simulate multi-source Audio with only JS?