# AudioMotionExtensions

Bind a float to AudioSource volume or pitch or to an exposed AudioMixer parameter.

Namespace: MeatMotion.Extensions

Assembly: MeatMotion

```csharp
public static class AudioMotionExtensions
```

Requires com.unity.modules.audio

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L7](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L7)

## BindToVolume

Schedule a tween that writes the interpolated value to Volume on the bound target and return its MotionHandle.

```csharp
public static MotionHandle BindToVolume(this FloatMotionBuilder builder, AudioSource audioSource)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `audioSource` (`AudioSource`) Target AudioSource that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L9](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L9)

```csharp
public static MotionHandle BindToVolume<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, AudioSource audioSource)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `audioSource` (`AudioSource`) Target AudioSource that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L12](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L12)

## BindToPitch

Schedule a tween that writes the interpolated value to Pitch on the bound target and return its MotionHandle.

```csharp
public static MotionHandle BindToPitch(this FloatMotionBuilder builder, AudioSource audioSource)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `audioSource` (`AudioSource`) Target AudioSource that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L17](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L17)

```csharp
public static MotionHandle BindToPitch<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, AudioSource audioSource)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `audioSource` (`AudioSource`) Target AudioSource that receives the update.
- Returns: `MotionHandle`

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L20](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L20)

## BindToAudioMixerFloat

Schedule a tween that writes the interpolated value to AudioMixerFloat on the bound target and return its MotionHandle.

```csharp
public static MotionHandle BindToAudioMixerFloat(this FloatMotionBuilder builder, AudioMixer audioMixer, string name)
```

Parameters and return value

- `builder` (`this FloatMotionBuilder`) Configured builder, passed as the receiver for extension calls.
- `audioMixer` (`AudioMixer`) Target AudioMixer that receives the update.
- `name` (`string`) Name of the target property.
- Returns: `MotionHandle`

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L25](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L25)

```csharp
public static MotionHandle BindToAudioMixerFloat<TOptions, TAdapter>(this MotionBuilder<float, TOptions, TAdapter> builder, AudioMixer audioMixer, string name)
    where TOptions : unmanaged, IMotionOptions
    where TAdapter : unmanaged, IMotionAdapter<float, TOptions>
```

Parameters and return value

- `builder` (`this MotionBuilder<float, TOptions, TAdapter>`) Configured builder, passed as the receiver for extension calls.
- `audioMixer` (`AudioMixer`) Target AudioMixer that receives the update.
- `name` (`string`) Name of the target property.
- Returns: `MotionHandle`

[Runtime/Bindings/Audio/AudioMotionExtensions.cs · L28](../../../source/Runtime/Bindings/Audio/AudioMotionExtensions.cs.html#L28)
