Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

IAudioEffect

interface in UnityEngine.Audio


Implements interfaces:ICapabilities

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Factory for instantiating EffectInstance to be used internally or from other scripts.

Implement IAudioEffect on a MonoBehaviour and add the component to the same GameObject as an AudioSource to process the audio source's signal with the effect. The audio source discovers the component automatically, calls IAudioEffect.CreateInstance, and owns the returned EffectInstance. Use AudioSource.GetEffectInstance to interact with the instance while it is playing.



IAudioEffects do not own any created EffectInstance instances, and they don't try to store these for scripting.





If you want to serialize a reference to a IAudioEffect, use the Serializable utility to store/load these references.

Additional resources: AudioSource.GetEffectInstance, ControlContext.AllocateEffect

Public Methods

Method Description
CreateInstance Ask this interface to create an EffectInstance.