That’s a fair point, but in this instance, you don’t need to do anything with the JavaScript, beyond link to it in your HTML. It works perfectly. (I’m back on my PC and have been able to test it.)
It is not possible to do what you want with the code you first posted, so one way or another, you need to rethink your approach.
You have started multiple threads here, all of which seem to be attempting to do much the same thing, using various different approaches, most of which you seem to have only a vague understanding of. I have the impression that you’re taking pieces of code found elsewhere on the Internet and trying to adapt them, without a basic understanding of how they work. It doesn’t seem to me to be a productive use of your time (or ours) to constantly go over the same ground with no sign of progress.
If you have a definite project in mind - a particular kind of site or page you want to build - a more sensible approach would be to outline clearly what it is you’re trying to achieve, and then allow the vastly-knowledgeable members here to guide you in doing it the right way. You would learn far more by that method than you will by continually tinkering with outdated code and ignoring sound advice.
Thanks, I already know this way, and, html5 audio is automatically disabled on internet explorer which I don’t use, but which I would want it to work on every browser.