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; 

http://www.w3schools.com/tags/av_prop_volume.asp


Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -