Description
The SpacialBlend
property of the SoundHandle
class determines how 3D the sound should be. A value of 0
indicates that the sound is not spatialized and will be perceived as a 2D sound, while a value of 1
means the sound is fully spatialized, providing a 3D audio experience.
Usage
Use the SpacialBlend
property to adjust the spatial characteristics of a sound. This can be useful for creating immersive audio experiences where the position and direction of sound sources are important. The property accepts a float
value between 0
and 1
, inclusive.
To set the SpacialBlend
property, simply assign a value within the specified range:
SoundHandle soundHandle = new SoundHandle();
soundHandle.SpacialBlend = 0.5f; // Set the sound to be partially spatialized
Example
// Example of setting the SpacialBlend property
SoundHandle soundHandle = new SoundHandle();
// Set the sound to be fully 3D
soundHandle.SpacialBlend = 1.0f;
// Set the sound to be 2D
soundHandle.SpacialBlend = 0.0f;
// Set the sound to be partially 3D
soundHandle.SpacialBlend = 0.5f;