Search completed in 0.91 seconds.
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
k.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/"?> <dialog id="clockdialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="clock" buttons="accept" onload="initclock();"> <script type="application/javascript" src="chrome://helloworld/content/clock.js"/> <hbox align="center"> <label value="current time:" /> <textbox id="
currenttime" /> </hbox> </dialog> listing 6: content for clock.js function initclock() { show
currenttime(); window.setinterval(show
currenttime, 1000); } function show
currenttime() { var textbox = document.getelementbyid("
currenttime"); textbox.value = new date().tolocaletimestring(); textbox.select(); } operations check perform an operations check to make sure that your changes to the sour...
..."chrome://global/skin/"?> <!doctype dialog system "chrome://helloworld/locale/clock.dtd"> <dialog id="clockdialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="&helloworld.clock;" buttons="accept" onload="initclock();"> <script type="application/javascript" src="chrome://helloworld/content/clock.js" /> <hbox align="center"> <label value="&helloworld.
currenttime;:" /> <textbox id="
currenttime" /> </hbox> </dialog> create the dtd that defines the entity references now create the dtd file that gets referred to by clock.xul (listing 9).
... value="&helloworld.
currenttime;:" /> <textbox id="
currenttime" /> </hbox> </dialog> create the dtd that defines the entity references now create the dtd file that gets referred to by clock.xul (listing 9).
... defines the entity references now create the dtd file that gets referred to by clock.xul (listing 9).
AudioListener.dopplerFactor - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.forwardX - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.forwardY - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.forwardZ - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.positionX - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.positionY - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.positionZ - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.setOrientation() - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.setPosition() - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.speedOfSound - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.upX - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.upY - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener.upZ - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioListener - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
AudioScheduledSourceNode.start() - Web APIs
ourcenode schedules a sound to begin playback at the specified time.
...e node is no longer running because of a prior call to stop().
...h is scheduled to start playing in 2 seconds and stop playing 1 second after that.
...2 seconds and stop playing 1 second after that.
BaseAudioContext.createDynamicsCompressor() - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
BaseAudioContext.createPanner() - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
DynamicsCompressorNode.attack - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
DynamicsCompressorNode.knee - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
DynamicsCompressorNode.ratio - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
DynamicsCompressorNode.release - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
DynamicsCompressorNode.threshold - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
DynamicsCompressorNode - Web APIs
add compression to an audio track.
...mple, have a look at our basic compressor example (view the source code).
... source code).
...feed the htmlmediaelement into it var source = audioctx.createmediaelementsource(myaudio); // create a compressor node var compressor = audioctx.createdynamicscompressor(); compressor.threshold.setvalueattime(-50, audioctx.
currenttime); compressor.knee.setvalueattime(40, audioctx.
currenttime); compressor.ratio.setvalueattime(12, audioctx.
currenttime); compressor.attack.setvalueattime(0, audioctx.
currenttime); compressor.release.setvalueattime(0.25, audioctx.
currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destin...
Timing element visibility with the Intersection Observer API - Web APIs
d's visibility timer previously (see handling document visibility changes and handling periodic actions), we've seen that when we need to update an ad's "total visible time" counter, we call a function named updateadtimer() to do so.
...nges and handling periodic actions), we've seen that when we need to update an ad's "total visible time" counter, we call a function named updateadtimer() to do so.
...mer() to do so.
...convert those to numbers easily enough—in fact, javascript generally does it automatically, although we'll have one instance where we have to do it ourselves.
PannerNode.distanceModel - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
PannerNode.maxDistance - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
PannerNode.panningModel - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
PannerNode.setOrientation() - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
PannerNode.setPosition() - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
PannerNode.setVelocity() - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
PannerNode - Web APIs
indow.webkitaudiocontext; var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; panner.distancemodel = 'inverse'; panner.refdistance = 1; panner.maxdistance = 10000; panner.rollofffactor = 1; panner.coneinnerangle = 360; panner.coneouterangle = 0; panner.coneoutergain = 0; if(panner.orientationx) { panner.orientationx.setvalueattime(1, audioctx.
currenttime); panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioct...
... panner.orientationy.setvalueattime(0, audioctx.
currenttime); panner.orientationz.setvalueattime(0, audioctx.
currenttime); } else { panner.setorientation(1,0,0); } var listener = audioctx.listener; if(listener.forwardx) { listener.forwardx.setvalueattime(0, audioctx.
currenttime); listener.forwardy.setvalueattime(0, audioctx.
currenttime); listener.forwardz.setvalueattime(-1, audioctx.
currenttime); listener.upx.setvalueattime(0, audioctx.
currenttime); listener.upy.setvalueattime(1, audioctx.
currenttime); listener.upz.setvalueattime(0, audioctx.
currenttime); } else { listener.setorientation(0,0,-1,0,1,0); } var source; var play = document.queryselector('.play'); var stop = document.queryselector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = doc...
...lector('.stop'); var boombox = document.queryselector('.boom-box'); var listenerdata = document.queryselector('.listener-data'); var pannerdata = document.queryselector('.panner-data'); leftbound = (-xpos) + 50; rightbound = xpos - 50; xiterator = width/150; // listener will always be in the same place for this demo if(listener.positionx) { listener.positionx.setvalueattime(xpos, audioctx.
currenttime); listener.positiony.setvalueattime(ypos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.
...pos, audioctx.
currenttime); listener.positionz.setvalueattime(300, audioctx.
currenttime); } else { listener.setposition(xpos,ypos,300); } listenerdata.innerhtml = 'listener data: x ' + xpos + ' y ' + ypos + ' z ' + 300; // panner will move as the boombox graphic moves around on the screen function positionpanner() { if(panner.positionx) { panner.positionx.setvalueattime(xpos, audioctx.
currenttime); panner.positiony.setvalueattime(ypos, audioctx.
currenttime); panner.positionz.setvalueattime(zpos, audioctx.
currenttime); } else { panner.setposition(xpos,ypos,zpos); } pannerdata.innerhtml = 'panner data: x ' + xpos + ' y ' + ypos + ' z ' + zpos; } note: in terms of working out what position values to apply to the listener and panner, to make the sound appropriate to what t...
SVGSVGElement - Web APIs
s document fragment to stand still until it is unpaused.
...rrently running animations that are defined within the svg document fragment, causing the animation clock to continue from the time at which it was suspended.
...if this svg document fragment is in a paused state.
... time in seconds relative to the start time for the current svg document fragment.
Media events - Developer guides
ast for a couple of frames.
... seeking sent when a seek operation begins.
...e volume is set and when the muted attribute is changed).
...[0]; v.addeventlistener("seeked", function() { v.play(); }, true); v.
currenttime = 10.0; this example fetches the first video element in the document and attaches an event listener to it, watching for the seeked event, which is sent whenever a seek operation completes.
Animation.playState - Web APIs
erated value describing the playback state of an animation.
...nsitions.
...ar duration: getrandommsrange(2000, 6000), // randomized for each tear iterations: infinity, easing: 'cubic-bezier(0.6, 0.04, 0.98, 0.335)' }); el.pause(); }); // play the tears falling when the ending needs to be shown.
AudioParam.setTargetAtTime() - Web APIs
al change to the audioparam value.
...ay or release portions of adsr envelopes.
...5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick attimeplus.onclick = function() { currgain = 1.0; gainnode.gain.settargetattime(1.0, audioctx.
currenttime + 1, 0.5); } attimeminus.onclick = function() { currgain = 0; gainnode.gain.settargetattime(0, audioctx.
currenttime + 1, 0.5); } specifications specification status comment web audio apithe definition of 'settargetattime' in that specification.
AudioParam.setValueAtTime() - Web APIs
the setvalueattime() method of the audioparam interface schedules an instant change to the audioparam value at a precise time, as measured against audiocontext.
currenttime.
... of this interface return void.
...de = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick targetattimeplus.onclick = function() { currgain += 0.25; gainnode.gain.setvalueattime(currgain, audioctx.
currenttime + 1); } targetattimeminus.onclick = function() { currgain -= 0.25; gainnode.gain.setvalueattime(currgain, audioctx.
currenttime + 1); } specifications specification status comment web audio apithe definition of 'setvalueattime' in that specification.
AudioParam.setValueCurveAtTime() - Web APIs
s representing the value curve the audioparam will change through along the specified duration.
... the audioparam will change through along the specified duration.
....connect(gainnode); gainnode.connect(audioctx.destination); // set button to do something onclick var wavearray = new float32array(9); wavearray[0] = 0.5; wavearray[1] = 1; wavearray[2] = 0.5; wavearray[3] = 0; wavearray[4] = 0.5; wavearray[5] = 1; wavearray[6] = 0.5; wavearray[7] = 0; wavearray[8] = 0.5; valuecurve.onclick = function() { gainnode.gain.setvaluecurveattime(wavearray, audioctx.
currenttime, 2); } specifications specification status comment web audio apithe definition of 'setvaluecurveattime' in that specification.
AudioScheduledSourceNode.stop() - Web APIs
de has already stopped, this method has no effect.
...mediately.
...es starting an oscillator node, scheduled to begin playing at once and to stop playing in one second.
AudioWorkletGlobalScope - Web APIs
's possible to define any other variables and perform any actions allowed in worklets — apart from defining audioworkletprocessor-derived classes.
...es.
...first we need to define the processor, and register it.
HTMLMediaElement: timeupdate event - Web APIs
the timeupdate event is fired when the time indicated by the
currenttime attribute has been updated.
... html5 media examples these examples add an event listener for the htmlmediaelement's timeupdate event, then post a message when that event handler has reacted to the event firing.
...e event frequency is dependant on the system load.
OscillatorNode.detune - Web APIs
the detune property of the oscillatornode interface is an a-rate audioparam representing detuning of oscillation in cents.
...iocontext to create an oscillator node.
... out our violent theremin demo (see app.js for relevant code).
OscillatorNode.start() - Web APIs
thod of the oscillatornode interface specifies the exact time to start playing the tone.
...tart playing the tone.
...of an audiocontext to create an oscillator node.
PannerNode.coneInnerAngle - Web APIs
this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.
currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.
... now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.orientationz.setvalueattime(z1, context.
currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orien...
....4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orientationz.setvalueattime(z2, context.
currenttime + 2); finally, let's connect all our nodes and start the oscillator!
PannerNode.coneOuterAngle - Web APIs
this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.
currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.
... now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.orientationz.setvalueattime(z1, context.
currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orien...
....4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orientationz.setvalueattime(z2, context.
currenttime + 2); finally, let's connect all our nodes and start the oscillator!
PannerNode.coneOuterGain - Web APIs
this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.
currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.
... now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.orientationz.setvalueattime(z1, context.
currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orien...
....4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orientationz.setvalueattime(z2, context.
currenttime + 2); finally, let's connect all our nodes and start the oscillator!
PannerNode.orientationX - Web APIs
this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.
currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.
... now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.orientationz.setvalueattime(z1, context.
currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orien...
....4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orientationz.setvalueattime(z2, context.
currenttime + 2); finally, let's connect all our nodes and start the oscillator!
PannerNode.orientationY - Web APIs
this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.
currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.
... now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.orientationz.setvalueattime(z1, context.
currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orien...
....4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orientationz.setvalueattime(z2, context.
currenttime + 2); finally, let's connect all our nodes and start the oscillator!
PannerNode.orientationZ - Web APIs
this value determines the volume of the sound outside of both inner and outer cone // setting it to 0 means there is no sound, so we can clearly hear when we leave the cone // 0 is also the default panner.coneoutergain = 0; // increase the z position to ensure the cone has an effect // (otherwise the sound is located at the same position as the listener) panner.positionz.setvalueattime(1, context.
currenttime); having set up the pannernode, we can now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.
... now schedule some updates to its y-axis rotation: // calculate the vector for no rotation // this means the sound will play at full volume const [x1, y1, z1] = yrotationtovector(0); // schedule the no-rotation vector immediately panner.orientationx.setvalueattime(x1, context.
currenttime); panner.orientationy.setvalueattime(y1, context.
currenttime); panner.orientationz.setvalueattime(z1, context.
currenttime); // calculate the vector for -22.4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orien...
....4 degrees // since our coneouterangle is 45, this will just about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.
currenttime + 2); panner.orientationy.setvalueattime(y2, context.
currenttime + 2); panner.orientationz.setvalueattime(z2, context.
currenttime + 2); finally, let's connect all our nodes and start the oscillator!
PannerNode.positionX - Web APIs
source's position, in 3d cartesian coordinates.
...alue is 0.
...or, and pans it to the left after 1 second, to the right after 2 seconds, and back to the center after 3 seconds.
PannerNode.positionY - Web APIs
after 1 second, below the listener after 2 seconds, and back to the center after 3 seconds.
...to the center after 3 seconds.
...ange will mainly affect the timbre of the oscillator, as it's a simple mono wave.
PannerNode.positionZ - Web APIs
fter 1 second, behind the listener after 2 seconds, and back to the listener's position after 3 seconds.
...o the listener's position after 3 seconds.
...case, the change will mainly affect the timbre and perceived volume of the sound.
Audio and Video Delivery - Developer guides
process is very similar with video — just remember to set isvideo=true in the flashvars value parameters.
...empty string will actually cause the browser to treat it as though you're setting a video source to a relative path.
...e property to determine the ranges of the media that are currently available for seeking to.
Animation.onfinish - Web APIs
animation completes naturally, as well as when the animation.finish() method is called to immediately cause the animation to finish up.
...rally, as well as when the animation.finish() method is called to immediately cause the animation to finish up.
Animation.pause() - Web APIs
the pause() method of the web animations api's animation interface suspends playback of the animation.
... the web animations api's animation interface suspends playback of the animation.
AudioBufferSourceNode.start() - Web APIs
he audiobuffersourcenode interface is used to schedule playback of the audio data contained in the buffer, or to begin playback immediately.
...is function once during the lifetime of an audiobuffersourcenode.