| OpenAL Specification and Reference | ||
|---|---|---|
| <<< Previous | State and State Requests | Next >>> |
The Doppler Effect depends on the velocities of Source and Listener relative to the medium, and the propagation speed of sound in that medium. The application might want to emphasize or de-emphasize the Doppler Effect as physically accurate calculation might not give the desired results. The amount of frequency shift (pitch change) is proportional to the speed of listener and source along their line of sight. The application can increase or decrease that frequency shift by specifying the scaling factor AL should apply to the result of the calculation.
The Doppler Effect as implemented by AL is described by the formula below. Effects of the medium (air, water) moving with respect to listener and source are ignored. DOPPLER_VELOCITY is the propagation speed relative to which the Source velocities are interpreted.
VD: DOPPLER_VELOCITY
DF: DOPPLER_FACTOR
vl: Listener velocity (scalar, projected on source-listener vector)
vs: Source verlocity (scalar, projected on source-listener vector)
f: Frequency in sample
f': effective Doppler shifted frequency
f' = DF * f * (VD-vl)/(VD+vs)
vl<0, vs>0 : source and listener approaching each other
vl>0, vs<0 : source and listener moving away from each other
There are two API calls global to the current context that provide control of the two related parameters. DOPPLER_FACTOR is a simple scaling to exaggerate or deemphasize the Doppler (pitch) shift resulting from the calculation.
void DopplerFactor ( float dopplerFactor );
DOPPLER_VELOCITY allows the application to change the reference (propagation) velocity used in the Doppler Effect calculation. This permits the application to use a velocity scale appropriate to its purposes.
void DopplerVelocity ( float dopplerVelocity);
| <<< Previous | Home | Next >>> |
| No Culling By Distance | Up | Listener and Sources |