Search completed in 1.42 seconds.
Migrating from webkitAudioContext - Web APIs
type property has been changed to use Web IDL enums. ...
... triangle waveform osc.
setWaveTable(table); var isCustom = (osc.type == osc.CUSTOM); // isCustom will be true // New standard AudioContext code: var osc = context.createOscillator(); osc.type = "sine"; // sine waveform osc.type = "square"; // square waveform osc.type = "sawtooth"; // sawtooth waveform osc.type = "triangle"; // triangle waveform osc.setPeriodicWave(table); // Note:
setWaveTable has been renamed to setPeriodicWave! var isCustom = (osc.type == "custom"); // isCustom will be true BiquadFilterNode.type BiquadFilterNode's type property has been changed to use Web IDL enums. Old code using webkitAudioContext can be ported to standards based AudioContext like below: // Old webkitAudioContext code: var filter = context.createBiquadFilter(); filter.type = filter.LOWPASS; ...
...c1, 0); // Some time later, query the number of sources... console.log(activeSources()); Renaming of WaveTable The WaveTable interface has been renamed to PeriodicWave. Here is how you can port old code using WaveTable to the standard AudioContext API: // Old webkitAudioContext code: var osc = context.createOscillator(); var table = context.createWaveTable(realArray, imaginaryArray); osc.
setWaveTable(table); // New standard AudioContext code: var osc = context.createOscillator(); var table = context.createPeriodicWave(realArray, imaginaryArray); osc.setPeriodicWave(table); Removal of some of the AudioParam read-only attributes The following read-only attributes have been removed from AudioParam: name, units, minValue, and maxValue. These used to be informational attributes. Here is some...
OscillatorNode - Web APIs
andler for the ended event, which fires when the tone has stopped playing. Methods Inherits methods from its parent, AudioScheduledSourceNode, and adds the following: OscillatorNode.setPeriodicWave() Sets a PeriodicWave which describes a periodic waveform to be used instead of one of the standard waveforms; calling this sets the type to custom. This replaces the now-obsolete OscillatorNode.
setWaveTable() method. OscillatorNode.start() Specifies the exact time to start playing the tone. OscillatorNode.stop() Specifies the time to stop playing the tone. Examples The following example shows basic usage of an AudioContext to create an oscillator node and to start playing a tone on it. For an applied example, check out our Violent Theremin demo (see app.js for relevant code). // create web a...