float Spacializing { get; set; }

robot_2Generated
code_blocksInput

Description

The Spacializing property of the Sandbox.Audio.Mixer class determines how sound is distributed across speakers. A value of 0 means the sound will be output through all speakers equally, while a value of 1 indicates that the sound will be fully spatialized, meaning it will be positioned in 3D space relative to the listener's position.

Usage

Use the Spacializing property to control the spatialization of audio in your application. Adjusting this property allows you to create more immersive audio experiences by controlling how sound is perceived in a 3D environment.

The property is decorated with a RangeAttribute that limits its value between 0 and 1, with a step of 0.01. This ensures that the property is set within a valid range for spatialization effects.

Example

// Example of setting the Spacializing property
Sandbox.Audio.Mixer audioMixer = new Sandbox.Audio.Mixer();
audioMixer.Spacializing = 0.75f; // Set the spatialization to 75%

// This will make the sound more directional, enhancing the 3D audio effect.