How to set the loudness of HTML5 audio?

Use the audio element’s volume property. From W3:

The element’s effective media volume is volume, interpreted relative
to the range 0.0 to 1.0, with 0.0 being silent, and 1.0 being the
loudest setting, values in between increasing in loudness. The range
need not be linear. The loudest setting may be lower than the system’s
loudest possible setting; for example the user could have set a
maximum volume.

Ex: sounds[id].volume=.5;

Leave a Comment