When using the custom attenuation function of a sound attached to a mesh, it seems like the distance calculated is always from the mesh to the scene’s active camera, even when the scene.audioListenerPositionProvider is set.
I’ve created an example here - https://playground.babylonjs.com/#G4PMF3#1
If the useCustomAttenuation property is set to false, or scene.audioListenerPositionProvider is not set, it works as expected.
I did not find any documentation that stated otherwise, so it seems to me like the distance provided to the custom attenuation function should also consider the audioListenerPositionProvider when it is set.
Please let me know what you think, thanks