Due to security concerns many modern web-browsers now require that the end-user interacts with the web-page before it will allow media (like audio & video) to autoplay, and this secutiry restriction is likely the reason why the audio file isn't playing.
We generally recommend making the first Passage of your project some sort of welcome / summury / credits / etc screen that contains a link to a second passage that is the actual start of your story/game, and to play your audio autoplay code within this second passage. This way the end-user has to interact with the page at least once via the selection of that link, which will satisfy the security restriction.
I tested your code example by placing it with a <script> HTML element in such a second passage and it played.
This is the second passage of the project and the actual start of the story/game.
var audio = document.createElement('audio');
audio.src = 'https://youhaveowl.com/wp-content/uploads/2019/05/636254_Purple-Circle.mp3';
audio.loop = true;