I'm starting in javascript and I have a simple project in hand but they're breaking my head. The project consists of creating a multitrack player (such as those recording studio software) where when clicking on play, the client can hear all the instruments recorded in the track in question. Here's an example I'm talking about: Multitrack.com
Well, I have the following markup:
<audio id="player" src="audio/1.mp3" controls="controls" preload="auto"></audio><br />
<audio id="player1" src="audio/2.mp3" controls="controls" preload="auto"></audio><br />
<audio id="player2" src="audio/3.mp3" controls="controls" preload="auto"></audio><br />
<button id="play">►</button>
And just below, the following javascript:
<script>
var play = document.getElementById('play');
play.addEventListener('click', function() {
player.play();
player1.play();
player2.play();
});
</script>
So far, okay. When I open a browser through the PC, audios load correctly, simultaneously. However, when opening the project by the Android phone, the audios start with delay (latency) which causes them not to be synchronized.
What's my mistake?
Is there any solution for this?
Or some way to make the audios synchronized ...