Version

menu_open
Wwise SDK 2024.1.0
Parameter Smoothing [Experimental]
Note: Parameter smoothing is an experimental feature. Refer to Spatial Audio Experimental Features

Acoustics Parameters

The Acoustics Engine simulates sound propagation within a virtual environment. It does this by generating and calculating discrete sound paths, which are then passed on to the Sound Engine for audio rendering. You can use the Voice Inspector to examine individual sound paths, which are characterized by the following parameters:

  • Position
  • Orientation
  • Distance
  • Occlusion
  • Obstruction
  • Diffraction
  • Transmission Loss
  • Spread
  • Aperture
  • Path Gain

These parameters are dynamic and can change rapidly in response to various inputs. For instance, the movement of Game Objects or the discovery of new environmental data by the Acoustics Engine can alter these values. Parameter smoothing uses an exponential moving average filter to limit the rate of change of these parameters over time.

Note: Parameter smoothing only applies to diffraction, transmission, and direct paths. Reflection paths are not processed by parameter smoothing.

Exponential Moving Average (EMA) and Smoothing Constant

Parameter smoothing uses an exponential moving average (EMA), where recent parameter values have a greater influence on the output than older values. A smoothing constant (AkSpatialAudioInitSettings::fSmoothingConstantMs) determines the degree of weighting decrease for previous observations.

This method ensures that sudden changes in parameters do not cause abrupt shifts in the audio output, which could be jarring to the listener. Instead, parameter changes are gradually introduced, preserving the natural evolution of the sound environment and maintaining a consistent audio experience.

The smoothing constant plays a crucial role in determining how quickly the EMA reacts to parameter changes. A larger value means that the EMA is more responsive to new data, while a smaller value produces a smoother, slower-moving average. You can adjust the value of the smoothing constant based on the desired responsiveness of the audio parameters to changes within the virtual environment.

Reducing CPU Usage with Parameter Smoothing

You can use parameter smoothing to save CPU usage by selecting conservative values for various other initialization settings. You can reduce the number of rays cast (AkSpatialAudioInitSettings::uNumberOfPrimaryRays) and also limit the number of diffraction paths (AkSpatialAudioInitSettings::uMaxDiffractionPaths) with only a minimal reduction in audio quality. When using parameter smoothing, we recommend that you experiment with various parameter adjustments to further optimize CPU usage: increase the movement threshold (AkSpatialAudioInitSettings::fMovementThreshold), the load balancing spread (AkSpatialAudioInitSettings::uLoadBalancingSpread), and the maximum diffraction order (AkSpatialAudioInitSettings::uMaxDiffractionOrder).

Number of Rays Cast Per Frame

The Acoustics Engine casts from the listener’s position to gather information about the environment. The accuracy of the simulation is proportional to the number of rays cast: when more rays are cast, more environmental data is gathered, leading to a more accurate simulation. However, casting additional rays requires more CPU resources. Therefore, it is desirable to find a balance by casting the minimum number of rays necessary to maintain an accurate simulation.

Insufficient ray casting can cause the acoustics engine to miss critical environmental features such as obstacles, reflective surfaces, or edges, especially in highly complex environments. This can lead to an incomplete perceptual understanding of the environment. At a later point in time, if new information is discovered, corrected paths will be computed and there will be discontinuities in the audio output.

Diffraction Settings

To mitigate CPU usage, you can reduce the number of diffraction paths per emitter, which is another factor that can contribute to audio discontinuities. Low values for AkSpatialAudioInitSettings::uMaxDiffractionPaths typically cause paths to pop in and out, because a shorter path around one side of an obstacle replaces a longer path.

You can also reduce the maximum diffraction order, which determines the maximum number of edges that a single path can contain. Low values for AkSpatialAudioInitSettings::uMaxDiffractionOrder can cause diffraction value discontinuities when the maximum number of edges is exceeded.

Using parameter smoothing to eliminate discontinuities from conservative diffraction settings makes these kinds of artifacts much less audible and provides a more continuous audio experience.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise