I have a page for which i need to play a sound (audio tag or js Audio object) at a specific instance. The audio file location is not in my local webserver, it's at another server accessed like 'https://site.com/folder/file.wav'
I need to access and load this file at page load and need to play it without having a delay. Adding my current code below
<script>
var player = new Audio();
$(document).ready(function () {
player.src = 'https://site.com/folder/file.wav';
});
function play()
{
player.play();
}
</script>
Problem i'm facing now is, if i'm running it from a computer with WIFI, it plays ontime; but if i run that from my android mobile it plays after 3-5 seconds.
Please advise.