carb::audio::RolloffDesc

Defined in carb/audio/IAudioPlayback.h

struct RolloffDesc

descriptor of the rolloff mode, range, and curves to use for an emitter.

Public Members

RolloffType type

the default type of rolloff calculation to use for all DSP values that are not overridden by a custom curve.

This defaults to RolloffType::eLinear.

float nearDistance

the near distance range for the sound.

This is specified in arbitrary world units. When a custom curve is used, this near distance will map to a distance of 0.0 on the curve. This must be less than the farDistance distance. The near distance is the closest distance that the emitter’s attributes start to rolloff at. At distances closer than this value, the calculated DSP values will always be the same as if they were at the near distance. This defaults to 0.0.

float farDistance

the far distance range for the sound.

This is specified in arbitrary world units. When a custom curve is used, this far distance will map to a distance of 1.0 on the curve. This must be greater than the nearDistance distance. The far distance is the furthest distance that the emitters attributes will rolloff at. At distances further than this value, the calculated DSP values will always be the same as if they were at the far distance (usually silence). Emitters further than this distance will often become inactive in the scene since they cannot be heard any more. This defaults to 10000.0.

RolloffCurve *volume

the custom curve used to calculate volume attenuation over distance.

This must be a normalized curve such that a distance of 0.0 maps to the nearDistance distance and a distance of 1.0 maps to the farDistance distance. When specified, this overrides the rolloff calculation specified by type when calculating volume attenuation. This defaults to nullptr.

RolloffCurve *lowFrequency

the custom curve used to calculate low frequency effect volume over distance.

This must be a normalized curve such that a distance of 0.0 maps to the nearDistance distance and a distance of 1.0 maps to the farDistance distance. When specified, this overrides the rolloff calculation specified by type when calculating the low frequency effect volume. This defaults to nullptr.

RolloffCurve *lowPassDirect

the custom curve used to calculate low pass filter parameter on the direct path over distance.

This must be a normalized curve such that a distance of 0.0 maps to the nearDistance distance and a distance of 1.0 maps to the farDistance distance. When specified, this overrides the rolloff calculation specified by type when calculating the low pass filter parameter. This defaults to nullptr.

RolloffCurve *lowPassReverb

the custom curve used to calculate low pass filter parameter on the reverb path over distance.

This must be a normalized curve such that a distance of 0.0 maps to the nearDistance distance and a distance of 1.0 maps to the farDistance distance. When specified, this overrides the rolloff calculation specified by type when calculating the low pass filter parameter. This defaults to nullptr.

RolloffCurve *reverb

the custom curve used to calculate reverb mix level over distance.

This must be a normalized curve such that a distance of 0.0 maps to the nearDistance distance and a distance of 1.0 maps to the farDistance distance. When specified, this overrides the rolloff calculation specified by type when calculating the low pass filter parameter. This defaults to nullptr.

void *ext = nullptr

reserved for future expansion.

This must be set to nullptr.