To adjust the volume of an audio element, you can utilize the volume
attribute:
<audio autoplay="autoplay" volume="0.5">
<source src="Media File here">
</audio>
The values for volume range from 0.0 (silent) to 1.0 (loudest).
update
It appears that the volume
attribute may not function as expected. Here is a workaround method:
audio_tags = document.getElementsByTagName('audio')
for (var i = 0; i < audio_tags.length; i++) {
audio_tags[i].addEventListener("loadstart", function() {
this.volume = this.getAttribute('volume');
}, true);
}
<audio controls="controls" volume="0.1">
<source src="https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>
<br /><br />
<audio controls="controls" volume="0.9">
<source src="https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg" type="audio/ogg">
Your browser does not support the audio element.
</audio>