Class AudioOccluder
Class that implements IAudioInfluencer to provide an audio occlusion effect, similar to listening to sound from outside of an enclosed space.
Implements
Namespace: Microsoft.MixedReality.Toolkit.Audio
Assembly: cs.temp.dll.dll
Syntax
public class AudioOccluder : MonoBehaviour, IAudioInfluencer
Remarks
Ensure that all sound emitting objects have an attached AudioInfluencerController. Failing to do so will result in the desired effect not being applied to the sound.
Properties
CutoffFrequency
Frequency above which sound will not be heard after applying occlusion. Setting this value to 22000.0 effectively disables the effect.
Declaration
public float CutoffFrequency { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
Chaining occluders will result in the lowest of the cutoff frequencies being applied to the sound. The CutoffFrequency range is 0.0 - 22000.0 (0 - 22kHz), inclusive. The default value is 5000.0 (5kHz).
VolumePassThrough
Percentage of the audio source volume that will be heard after applying occlusion.
Declaration
public float VolumePassThrough { get; set; }
Property Value
Type | Description |
---|---|
Single |
Remarks
VolumePassThrough is cumulative. It is applied to the current volume of the object at the time the effect is applied. The VolumePassThrough range is from 0.0 - 1.0 (0-100%), inclusive. The default value is 1.0.
Methods
ApplyEffect(GameObject)
Applies an audio effect.
Declaration
public void ApplyEffect(GameObject soundEmittingObject)
Parameters
Type | Name | Description |
---|---|---|
GameObject | soundEmittingObject | The GameObject on which the effect is to be applied. |
RemoveEffect(GameObject)
Removes a previously applied audio effect.
Declaration
public void RemoveEffect(GameObject soundEmittingObject)
Parameters
Type | Name | Description |
---|---|---|
GameObject | soundEmittingObject | The GameObject from which the effect is to be removed. |