I am writing a simple game by JavaScript, in which sound should be parallel with JavaScript.
I am using setInterval and I should be sure if the sound is playing correct, without pauses and delays.
I think about it this way: user can start game, when audio is loaded.
How can I do it? Maybe you can advise me another way.
Have a look at JPlayer, you could load the audio track:
And then when your game is ready to start playing call:
or if you want to check if the audio is playing: