---
tags:
    - "Set"
    - "Change"
    - "Modify"
    - "Assign"
    - "Clip"
---

# Set Audio Resource

[Set](index.md) / **Set Audio Resource**

## Description

Sets an Audio Resource value

## Parameters

| Name | Description |
| :--- | :---------- |
| Set | Where the value is stored |
| Value | The value to store |

## Code

```cs
using System;
using UnityEngine;
using UnityEngine.Audio;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Set Audio Resource")]
    [Image(typeof(IconAudioClip), ColorTheme.Type.Yellow)]
    
    [Description("Sets an Audio Resource value")]
    [Category("Set/Set Audio Resource")]
    
    [Parameter("Set", "Where the value is stored")]
    [Parameter("Value", "The value to store")]
    
    [Keywords("Set", "Change", "Modify", "Assign", "Clip")]
    
    [Serializable]
    public class InstructionCoreSetAudioResource : Instruction
    {
        [SerializeField] private SetAudioResource m_Set = new SetAudioResource();
        [SerializeField] private GetAudioResource m_Value = new GetAudioResource();

        protected override string GetTitle(GameObject source) => $"{this.m_Set} = {this.m_Value}";

        protected override Awaitable Run(Args args)
        {
            AudioResource value = this.m_Value.Get(args);
            this.m_Set.Set(value, args);
            
            return Done;
        }
    }
}
```

