Closed pmlt closed 1 year ago
Thanks for filing this. As discussed in theF2F meeting, this isn't a problem and we'd do this.
Checking the docs it appears you can already do this by choosing DistanceModelType "linear" and setting the rolloffFactor to 0. Thus you will be left with a constant gain of 1. If this use case was added to the documentation then no change to the specification would be needed.
linear: A linear distance model calculating the gain induced by the distance according to: 1 - rolloffFactor * (distance - refDistance) / (maxDistance - refDistance)
See https://developer.mozilla.org/en-US/docs/Web/API/PannerNode/distanceModel
TPAC 2021:
This tool is really excellent if you want to visualise the falloff models and how the parameters affect them: https://www.desmos.com/calculator/lzxfqvwoqq
We've verified that 1. in https://github.com/WebAudio/web-audio-api/issues/2387#issuecomment-953056392 is correct, so we don't have to change anything here. The default is 1
, but setting it to 0
removes attenuation altogether (keeping the panning).
https://github.com/mdn/content/edit/main/files/en-us/web/api/pannernode/distancemodel/index.md allows editing the MDN documentation (anybody can edit, there are reviewers to help if need be).
Describe the feature When using the PannerNode, the volume of the source is attenuated based on distance from the listener. However, some game engines will already have implemented and applied some distance-based attenuation on the input PCM data prior to it being fed to a PannerNode.
The point of this feature is to allow taking advantage of the high-quality HRTFs of PannerNode without having to juggle two distance-based attenuation systems.
Is there a prototype? Basically, adding the "none" value to the accepted values for DistanceModelType:
Describe the feature in more detail When "none" is specified as the
distanceModel
of the node, the node should perform no volume attenuation based on distance whatsoever.