Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

0 votes
in General Discussion by Guillaume R. (Audiokinetic) (5.8k points)

1 Answer

0 votes

There is currently no built-in Doppler effect in Wwise. You can however create Doppler type effects by applying RTPC (Real Time Parameter Control) to the pitch of a Wwise objectcontained within the Actor Mixer Hierarchy, based on the relative speed of the game objectand the listener.

The rate at which the object is approaching/leaving must be computed by your game and fed to the sound engine via AK::SoundEngine::SetRTPC(). This value is used as the X axis in your RTPC curve in Wwise. This curve must be arranged so that:

  • When the distance between the listener and the object is not changing over time, pitch is not be affected
  • When the distance is decreasing over time, pitch is increased proportionally with the rate at which the distance is decreasing
  • When the distance is increasing over time, pitch is decreased proportionally with the rate at which the distance is increasing

Note that if the object is on a trajectory that comes very close to the listener, the change between "the distance is decreasing" and "the distance is increasing" will be very sudden, and the pitch shift will go from positive to negative very quickly, producing an unpleasant effect. You may need to "smooth" the Game Parameter value based on distance: This game parameter would be the rate at which the object is approaching/leaving the listener, but would be gradually brought nearer to the neutral position when the game object is getting close to the listener.

The pitch node used in the Wwise Sound Engine pipeline has been highly optimized for re-sampling, allowing for playback to be sped up or slowed down in real time. This is by far the least CPU intensive procedure for creating Doppler effects. 

Considerations 
When multiple listeners (including split screen) are used in Wwise, Doppler effects using pitch require special design considerations. In real-life, the sound may result in a different pitch value for each listener based on the velocity between the game object and each listener. Since in Wwise game objects use a single instance for each playing sound, having two unique pitch values for a single sound is not possible. Therefore, a single pitch value needs to be determined programmatically.

Another, more costly alternative is to duplicate game objects -- for example a split-screen racing game could create 2 game objects for each car, play sounds on both game objects, and compute the speed of the car relative to each listener. This may produce undesired effects if both listeners are played through the same speakers, but if listeners are playing through different speakers (using AK::SoundEngine::SetListenerSpatialization()) then it should be Ok.

by Guillaume R. (Audiokinetic) (5.8k points)
Since you can connect an RTPC to distance I'm assuming that the information on distance between a given listener and a given emitter is already known by the sound engine and you could look them up each frame.

These informations seem to be stored in a AkEmitterListenerPair, but the only getters I can find for that, GetEmitterListenerPair and Get3DPosition seem to be for use inside plugins and not the engine itself.

Am I missing something ?
...