You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @rserota, great work on this script! It works like a charm, just one thing is not clear to me.
With code just like
varsaw=newWad({source: 'sine'});
stereo panning seems to be used by default. So following line:
saw.play({panning: [10,0,10]});
throws an exception Uncaught TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite. at line 473 in wad.js.
Setting up 3d panning manually:
varsaw=newWad({source: 'sine',panning: [0,0,0]});// or 'panning: []'
fixes the thing.
And as I just figured out, this code:
gives again an error: Uncaught TypeError: Failed to execute 'setPosition' on 'PannerNode': The provided float value is non-finite. (line 468).
So, the question is if it's possible to change panning type after Wad is created? And can it be made automatically?
P.S. Should be in setUpPanningOnPlay not current Wad's but arg's panning type checked? Like
varsetUpPanningOnPlay=function(that,arg){varpanning=arg&&arg.panning;// can be zero provided as argumentif(typeof(panning)==='undefined')panning=that.panning.location;if(typeof(panning)==='number'){that.panning.node=context.createStereoPanner();that.panning.node.pan.value=panning;}else{that.panning.node=context.createPanner();that.panning.node.setPosition(panning[0],panning[1],panning[2]);}that.nodes.push(that.panning.node);};
or similar, I guess?
The text was updated successfully, but these errors were encountered:
My original intention was that once you initialize a Wad with one panner, you couldn't switch it to the other type on the fly. I just didn't think it really made sense, though I guess if you know what you're doing, there isn't really any harm.
Would you like to test your suggested code and submit it as a pull request? You'd also need to modify the setPanning method to be more dynamic, similarly to what you did with setUpPanningOnPlay.
I implemented the change you suggested (and updated other relevant code). If you pull down fresh code, it should work the way you want. You can now switch between 3d and stereo panning on the fly.
Hi @rserota, great work on this script! It works like a charm, just one thing is not clear to me.
With code just like
stereo panning seems to be used by default. So following line:
throws an exception
Uncaught TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite.
at line473
inwad.js
.Setting up 3d panning manually:
fixes the thing.
And as I just figured out, this code:
gives again an error:
Uncaught TypeError: Failed to execute 'setPosition' on 'PannerNode': The provided float value is non-finite.
(line468
).So, the question is if it's possible to change panning type after
Wad
is created? And can it be made automatically?P.S. Should be in setUpPanningOnPlay not current
Wad
's butarg
's panning type checked? Likeor similar, I guess?
The text was updated successfully, but these errors were encountered: