float OcclusionRadius { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The OcclusionRadius property of the SoundEvent class specifies the radius within which the sound's occlusion is calculated. This property is measured in inches and determines how the sound interacts with the surrounding environment, particularly in terms of being blocked or muffled by obstacles.

Usage

Use the OcclusionRadius property to define the area around the sound source where occlusion effects are applied. This can be useful for creating more realistic audio experiences in environments with complex geometry, where sounds should be affected by walls, objects, or other barriers.

The property is part of the Occlusion toggle group, meaning it is only relevant if occlusion is enabled for the sound event. The value can range from 0 to 256 inches, allowing for fine-tuning of the occlusion effect's reach.

Example

// Example of setting the OcclusionRadius for a SoundEvent
SoundEvent mySoundEvent = new SoundEvent();
mySoundEvent.Occlusion = true; // Enable occlusion
mySoundEvent.OcclusionRadius = 100.0f; // Set occlusion radius to 100 inches

// This configuration will ensure that the sound is occluded within a 100-inch radius.