Units of Space: Distance Scale

OpenAL does not define the units of measurement for distances. The application is free to use meters, inches, or parsec. As sound effects are often not meant to accuretly model realities of physics, all OpenAL operations that compute distance are affected by scaling parameters the application can set as needed. Attenuation and other distance dependend effects are defined per unit distance (a distance of 1).

The applicaton can set a global scaling that will be multiplied into all distance calculations.

void DistanceScale ( float dScale );

A negative or zero scale will result in an INVALID_VALUE error, the command is then ignored. The default value is 1. The current setting can be queried using GetFloatv and DISTANCE_SCALE.

NoteAnnotation/ Distance Calculations
 

The specification does not guarantee that the distances used by the AL implementation are calculated using the euclidean norm. Implementations are free to use more efficient means to approximate the actual distance. Neither does the specification guarantee any upper limits on distance calculation errors.

NoteAnnotation/ Distance Dependend Processing
 

Distance affects attenuation, culling and clamping of Sources. It also affects calculations that attempt to model sound propagation with finite speed, whether a stochastic model or a simulation is used. In other words, latencies, decay times, and other parameters of early reflections and reverbration depend on the distance calculation.

NoteAnnotation/ DS3D DistanceFactor
 

The DS3D documentation explicitely states that the default unit is 1 meter. OpenAL does not specify any units. The distance e.g. between Source and Listener has to be interpreted given the scaling factor, the distance model used for attenuation, and the sound propagation speed.

NoteAnnotation/ DS3D/EAX RolloffFactor
 

The DS3D and EAX approach uses a RolloffFactor as a scaling multiplier to the source/listener distance (corrected by min_distance). At this time OpenAL does not support per-Source scaling of distance. The global distance scale combined with Source GAIN is used to accomplish a similar effect.

NoteAnnotation/ High Frequency Rolloff
 

To simulate different atmospheric conditions, a frequency dependend attenuation is used in A3D, EAX, and I3DL2. At this time OpenAL does not have a mechanism to specify lowpass filtering parameterized by distance.