How to set volume of audio object?
i use:
let music = new audio({
loop: true,
volume: 1,
src: ['/yourSounds/music.mp3']
})
it is easer to type
It's not a function, it's a property called volume
.
audio.volume = 0.2;
HTMLMediaElement volume MDN