How to play sound files with Javascript

Trigger multiple audio files with one button


- The code below allows for the triggering of multiple audio files at the same time with one play and one pause button. This method has very bad latency and syncing issues.The code below is a good way to demonstrate this. To use, just replace "Your_Audio_File" 1 & 2 with your own audio files. If you are using Firefox you will have to use .ogg files. Then paste into an html document.