Good news everybody
I read somewhere that once you’ve played the sound once on a user interaction,
you can then play it again without further interaction.
So set volume to zero and play all loaded sounds in one go at start.
I had a listener on 'touchstart' with a single instantiated function
that played all the sounds once the user touches the screen.
Here's how I did it in my REACT componentDidMount()
componentDidMount()
{
let that = this;
document.body.addEventListener('touchstart', function(evt) //First touch event on the screen will trigger this
{
console.log("Audio Setup for iOS:", that.state.allow_sound);
if(!that.state.allow_sound)
{
var Audio1 = document.getElementById("ping");
Audio1.load();
Audio1.volume = 0;
Audio1.play();
var Audio2 = document.getElementById("boom");
Audio2.load();
Audio2.volume = 0;
Audio2.play();
var Audio3 = document.getElementById("splash");
Audio3.load();
Audio3.volume = 0;
Audio3.play();
var Audio4 = document.getElementById("hit");
Audio4.load();
Audio4.volume = 0;
Audio4.play();
that.setState({allow_sound : true})
}
});
}
Then you can call these sounds dynamically from within the code.