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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -