---
tags:
    - "Audio, Sound, Music, Ambient, Sfx"
---

# Audio Source Set Gamepad Speaker Restricted Audio

[Audio](../index.md) / [Audio Source](index.md) / **Audio Source Set Gamepad Speaker Restricted Audio**

## Description

Compares the Set Gamepad Speaker Restricted Audio method of Audio Source component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Audio Source |  |
| Slot |  |
| Restricted |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

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

namespace VisualScript.Runtime
{
    [Title("Audio Source Set Gamepad Speaker Restricted Audio")]
    [Category("Audio/Audio Source/Set Gamepad Speaker Restricted Audio")]
    [Description("Compares the Set Gamepad Speaker Restricted Audio method of Audio Source component to another value")]
    
    [Image(typeof(IconAudioSource), ColorTheme.Type.Yellow)]
    [Keywords("Audio, Sound, Music, Ambient, Sfx")]
    
    [Parameter("Audio Source")]
    [Parameter("Slot")]
    [Parameter("Restricted")]
    
    [Serializable]
    public class GenConditionBool_AudioSource_CheckSetGamepadSpeakerRestrictedAudio_2 : Condition
    {
        [SerializeField] private GetGameObject m_AudioSource = new GetGameObject(
            new GenTypeGameObject_AudioSource()
        );
        
        [SerializeField] private GetInteger m_Slot = new GetInteger();
        
        [SerializeField] private GetBool m_Restricted = new GetBool();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Gamepad Speaker Restricted Audio");
            string parameters = $"({this.m_Slot}, {this.m_Restricted})";
            return $"{this.m_AudioSource} {method}";
        }
        
        protected override bool Run(Args args)
        {
            AudioSource component = this.m_AudioSource.Get<AudioSource>(args);
            if (component == null) return false;
            
            bool value = component.SetGamepadSpeakerRestrictedAudio(
                (int) this.m_Slot.Get(args),
                (bool) this.m_Restricted.Get(args)
            );
            
            return value;
        }
    }
}


```

