Hi Creators,
We recently released the new Audio API, which added a bunch of new audio instances for controlling sound in your experiences. Thank you to everyone who has tried it out and left feedback on it.
Today, we’re excited to release our newest addition to the Audio API beta: a distance attenuation API for AudioEmitter
s. This unlocks functionality that many of you asked us about concerning custom rolloff distances for emitters, similar to the controls available for Sound
instances.
With this update, AudioEmitter
now includes the methods GetDistanceAttenuation()
and SetDistanceAttenuation()
. Using these, you can assign each AudioEmitter
a custom volume-over-distance function of your design. You can draw tapered curves or minimum distances like before, but you can also make a spike at a certain distance, drop to zero instantly, or even make the volume increase! This offers a greater level of flexibility compared to what was available for Sounds.
Note: these curves use linear interpolation right now, but we may add something more spline-like in the future. More info about the accepted curve format, including sample script usage, can be found in our documentation.
To help with this, we’re providing a visual editing tool that you can use to see your rolloff curve and shape it however you imagine. This works a lot like our existing NumberSequence
editor, but with some extra features, such as the ability to change the grid scale by scrolling up and down.
We hope you try it out! Like the rest of the new Audio API, custom rolloff curves are usable in live experiences, but as it’s still in beta, we’re hoping to iterate further on the feature based on your needs for sound design. Let us know what you think!