The HTML5 <audio> tag

The HTML <audio> element is used to embed sound content in documents. The most basic playback functionality can be made available using the controls attribute. Example:



Instead of that, we can implement a custom control:

The Web Audio API

The Web Audio API provides a powerful and versatile system for controlling audio on the Web, allowing developers to choose audio sources, add effects to audio, create audio visualizations, apply spatial effects (such as panning) and much more. This could be useful when playing more than one sound at once, where we need to control the timing of each of them.