-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audio: how to set distance attenuation/fall-off? #402
Comments
You control this through the standard The fall-off curves are provided via the
Default curves are used if these pointers are https://github.com/microsoft/DirectXTK/wiki/AudioEmitter#custom-distance-curves |
@walbourn I checked the function EnableDefaultCurves that you mentioned and it sets a volume curve that is 1.0f at a distance of both 0.0f AND 1.0f (aka max volume regardless of distance). Is this intentional? It doesn't seem to match the description you gave of it having linear falloff. |
EnableDefaultCurves is implemented based on this code from XACT:
I see that my description of the default curve is probably wrong since it seems to turn off distance attenuation as you note. I'm not sure why as its' difficult to locate the old XACT docs these days and when you go look at them, they aren't really that detailed. That said, the easy fix is to just use |
Thanks @walbourn, I did indeed implement it using the curves myself already as you suggested. Thanks for the help, issue resolved. Possibly also worth noting that the default curves (those used when not calling EnableDefaultCurves or setting curves manually) do also not have any attenuation/falloff (that I could notice). Hope this helps. |
No description provided.
The text was updated successfully, but these errors were encountered: