mrtk_developmentreleases/2.0.0releases/2.1.0releases/2.2.0

    Show / Hide Table of Contents

    Class AudioOccluder

    Class that implements IAudioInfluencer to provide an audio occlusion effect, similar to listening to sound from outside of an enclosed space.

    Inheritance
    Object
    AudioOccluder
    Implements
    IAudioInfluencer
    MonoBehaviour
    Namespace: Microsoft.MixedReality.Toolkit.Audio
    Assembly: cs.temp.dll.dll
    Syntax
    public class AudioOccluder : MonoBehaviour, IAudioInfluencer, MonoBehaviour
    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).

    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.

    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)

    Declaration
    public void ApplyEffect(GameObject soundEmittingObject)
    Parameters
    Type Name Description
    GameObject soundEmittingObject

    ApplyEffect(GameObject)

    Declaration
    public void ApplyEffect(GameObject soundEmittingObject)
    Parameters
    Type Name Description
    GameObject soundEmittingObject

    RemoveEffect(GameObject)

    Declaration
    public void RemoveEffect(GameObject soundEmittingObject)
    Parameters
    Type Name Description
    GameObject soundEmittingObject

    RemoveEffect(GameObject)

    Declaration
    public void RemoveEffect(GameObject soundEmittingObject)
    Parameters
    Type Name Description
    GameObject soundEmittingObject

    Implements

    IAudioInfluencer
    MonoBehaviour
    In This Article
    • Properties
      • CutoffFrequency
      • CutoffFrequency
      • VolumePassThrough
      • VolumePassThrough
    • Methods
      • ApplyEffect(GameObject)
      • ApplyEffect(GameObject)
      • RemoveEffect(GameObject)
      • RemoveEffect(GameObject)
    • Implements
    Back to top Generated by DocFX