javascript - How to set volume of audio object? -
i know can create audio object this:
var audio = new audio("test.wav");
and know how can play audio:
audio.play();
i used following for
loop output functions audio
:
var myaudioobject = new audio(); (var key in myaudioobject) { if (typeof myaudioobject[key] === "function") { console.log(key); } }
but there no setting volume. possible change volume in audio object?
hint
it fault. if replace function
in loop number
find volume.
var myaudioobject = new audio(); (var key in myaudioobject) { if (typeof myaudioobject[key] === "number") { console.log(key); } }
it's not function, it's property called volume
.
audio.volume = 0.2;
Comments
Post a Comment