@@ -60,15 +60,15 @@ var FX = new Class({
6060
6161 // Set the values
6262
63- this . volume . gain . setTargetAtTime ( this . volumeValue , 0 , 0.01 ) ;
64-
63+ this . volume . gain . setValueAtTime ( this . volumeValue , 0 ) ;
64+
6565 if ( ! ctx . createStereoPanner )
6666 {
6767 this . pan . setPosition ( this . panValue , 0 , 1 - Math . abs ( this . panValue ) ) ;
6868 }
6969 else
7070 {
71- this . pan . pan . setTargetAtTime ( this . panValue , 0 , 0.01 ) ;
71+ this . pan . pan . setValueAtTime ( this . panValue , 0 ) ;
7272 }
7373
7474 // Create an oscillator, gain and pan nodes, and connect them together to the destination
@@ -84,14 +84,14 @@ var FX = new Class({
8484
8585 if ( this . randomValue > 0 )
8686 {
87- oscillator . frequency . setTargetAtTime ( Between (
87+ oscillator . frequency . setValueAtTime ( Between (
8888 this . frequencyValue - this . randomValue / 2 ,
8989 this . frequencyValue + this . randomValue / 2
90- ) , 0 , 0.01 ) ;
90+ ) , 0 ) ;
9191 }
9292 else
9393 {
94- oscillator . frequency . setTargetAtTime ( this . frequencyValue , 0 , 0.01 ) ;
94+ oscillator . frequency . setValueAtTime ( this . frequencyValue , 0 ) ;
9595 }
9696
9797 // Apply effects
@@ -138,9 +138,9 @@ var FX = new Class({
138138 {
139139 oscillator . start ( this . audioContext . currentTime + this . wait ) ;
140140
141- //Oscillators have to be stopped otherwise they accumulate in
141+ //Oscillators have to be stopped otherwise they accumulate in
142142 //memory and tax the CPU. They'll be stopped after a default
143- //timeout of 2 seconds, which should be enough for most sound
143+ //timeout of 2 seconds, which should be enough for most sound
144144 //effects. Override this in the `soundEffect` parameters if you
145145 //need a longer sound
146146
@@ -149,7 +149,7 @@ var FX = new Class({
149149
150150 fadeIn : function ( volume )
151151 {
152- volume . gain . setTargetAtTime ( 0 , this . audioContext . currentTime , 0.01 ) ;
152+ volume . gain . setValueAtTime ( 0 , 0 ) ;
153153
154154 volume . gain . linearRampToValueAtTime ( 0 , this . audioContext . currentTime + this . wait ) ;
155155
@@ -182,12 +182,12 @@ var FX = new Class({
182182
183183 // Set the node values
184184
185- feedback . gain . setTargetAtTime ( this . echoFeedback , 0 , 0.01 ) ;
186- delay . delayTime . setTargetAtTime ( this . echoDelay , 0 , 0.01 ) ;
185+ feedback . gain . setValueAtTime ( this . echoFeedback , 0 ) ;
186+ delay . delayTime . setValueAtTime ( this . echoDelay , 0 ) ;
187187
188188 if ( this . echoFilter )
189189 {
190- filter . frequency . setTargetAtTime ( this . echoFilter , 0 , 0.01 ) ;
190+ filter . frequency . setValueAtTime ( this . echoFilter , 0 ) ;
191191 }
192192
193193 // Create the delay feedback loop (with optional filtering)
@@ -245,8 +245,8 @@ var FX = new Class({
245245 var d2Volume = ctx . createGain ( ) ;
246246
247247 // Set the volume to the `volumeValue`
248- d1Volume . gain . setTargetAtTime ( this . volumeValue , 0 , 0.01 ) ;
249- d2Volume . gain . setTargetAtTime ( this . volumeValue , 0 , 0.01 ) ;
248+ d1Volume . gain . setValueAtTime ( this . volumeValue , 0 ) ;
249+ d2Volume . gain . setValueAtTime ( this . volumeValue , 0 ) ;
250250
251251 // Connect the oscillators to the gain and destination nodes
252252 d1 . connect ( d1Volume ) ;
@@ -261,8 +261,8 @@ var FX = new Class({
261261
262262 // Make the two oscillators play at frequencies above and below the main sound's frequency.
263263 // Use whatever value was supplied by the `dissonance` argument
264- d1 . frequency . setTargetAtTime ( this . frequencyValue + this . dissonance , 0 , 0.01 ) ;
265- d2 . frequency . setTargetAtTime ( this . frequencyValue - this . dissonance , 0 , 0.01 ) ;
264+ d1 . frequency . setValueAtTime ( this . frequencyValue + this . dissonance , 0 ) ;
265+ d2 . frequency . setValueAtTime ( this . frequencyValue - this . dissonance , 0 ) ;
266266
267267 // Fade in / out, pitch bend and play the oscillators to match the main sound
268268 if ( this . attack > 0 )
0 commit comments