# GetEffectInstance<TComponent>(TComponent)

> Gets a handle to the effect instantiated from a specific IAudioEffect component attached to this AudioSource 's GameObject.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.AudioModule

## GetEffectInstance\<T>(T)

```csharp
public ProcessorInstance GetEffectInstance<TComponent>(TComponent effectComponent) where TComponent : Component, IAudioEffect
```

### Parameters

**** (T): Component implementing [IAudioEffect](/engine/6000.7/script-reference/unityengine/audio/iaudioeffect.md) on the same GameObject as this [AudioSource](/engine/6000.7/script-reference/unityengine/audiosource.md).

### Returns

| Type                                                                                        | Description                                                                                                                                                                                    |
| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [ProcessorInstance](/engine/6000.7/script-reference/unityengine/audio/processorinstance.md) | The [ProcessorInstance](/engine/6000.7/script-reference/unityengine/audio/processorinstance.md) for the effect, or a default-initialized instance if the component has no instantiated effect. |

### Remarks

Use this for runtime scripting control of an attached effect while it is playing, for example to send messages with [ControlContext.SendMessage](/engine/6000.7/script-reference/unityengine/audio/controlcontext/sendmessage.md). Since the [AudioSource](/engine/6000.7/script-reference/unityengine/audiosource.md) owns the instance, check for its existence using [ControlContext.Exists](/engine/6000.7/script-reference/unityengine/audio/controlcontext/exists.md).
