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
The source of this bug is in code located in howler.spatial.js within Howl.prototype.pannerAttr
The variable pa is set to an object instead of mutated. Then, sound._panner does not exist, and the updated pa variable is discarded
See the following:
var pa = sound._pannerAttr;
pa = {
coneInnerAngle: typeof o.coneInnerAngle !== 'undefined' ? o.coneInnerAngle : pa.coneInnerAngle,
coneOuterAngle: typeof o.coneOuterAngle !== 'undefined' ? o.coneOuterAngle : pa.coneOuterAngle,
coneOuterGain: typeof o.coneOuterGain !== 'undefined' ? o.coneOuterGain : pa.coneOuterGain,
distanceModel: typeof o.distanceModel !== 'undefined' ? o.distanceModel : pa.distanceModel,
maxDistance: typeof o.maxDistance !== 'undefined' ? o.maxDistance : pa.maxDistance,
refDistance: typeof o.refDistance !== 'undefined' ? o.refDistance : pa.refDistance,
rolloffFactor: typeof o.rolloffFactor !== 'undefined' ? o.rolloffFactor : pa.rolloffFactor,
panningModel: typeof o.panningModel !== 'undefined' ? o.panningModel : pa.panningModel
};
// Update the panner values or create a new panner if none exists.
var panner = sound._panner;
if (panner) {
panner.coneInnerAngle = pa.coneInnerAngle;
panner.coneOuterAngle = pa.coneOuterAngle;
panner.coneOuterGain = pa.coneOuterGain;
panner.distanceModel = pa.distanceModel;
panner.maxDistance = pa.maxDistance;
panner.refDistance = pa.refDistance;
panner.rolloffFactor = pa.rolloffFactor;
panner.panningModel = pa.panningModel;
} else {
// Make sure we have a position to setup the node with.
if (!sound._pos) {
sound._pos = self._pos || [0, 0, -0.5];
}
// Create a new panner node.
setupPanner(sound, 'spatial');
}
I am calling pannerAttr directly after Howl construction, perhaps sound._panner would have existed if I had called play first.
I've worked around this by calling pannerAttr twice - which solves the issue.
Presumably this could be fixed by directly mutating sound._pannerAttr so the correct values can be used within setupPanner.
The text was updated successfully, but these errors were encountered:
MCArth
changed the title
pannerAttr(o) doesn't apply the passed options the first time it is called
pannerAttr(o) doesn't apply passed options the first time it is called
Jul 18, 2021
I hope @goldfire will be able to fix this, but in the meantime here's a quick fix I'm using to declare the options twice:
varsound=newHowl({src: ['path/to/audio.mp3')],});sound.pannerAttr({// your options here});sound.pannerAttr(sound.pannerAttr());// <- add this right after defining pannerAttr
The source of this bug is in code located in howler.spatial.js within Howl.prototype.pannerAttr
The variable pa is set to an object instead of mutated. Then, sound._panner does not exist, and the updated pa variable is discarded
See the following:
I am calling pannerAttr directly after Howl construction, perhaps sound._panner would have existed if I had called play first.
I've worked around this by calling pannerAttr twice - which solves the issue.
Presumably this could be fixed by directly mutating sound._pannerAttr so the correct values can be used within setupPanner.
The text was updated successfully, but these errors were encountered: