---
tags:
    - "Noise"
    - "Level"
---

# Ambient Volume

[Audio](../index.md) / [Volume](index.md) / **Ambient Volume**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :green_circle: Can Write

</div>

## Description

The current volume of the Ambient channel

## Code

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

namespace VisualScript.Runtime
{
    [Get, Set]

    [Title("Ambient Volume")]
    [Category("Audio/Volume/Ambient")]

    [Description("The current volume of the Ambient channel")]
    [Image(typeof(IconBird), ColorTheme.Type.Yellow, typeof(BadgeVolume))]

    [Keywords("Noise", "Level")]

    [Serializable]
    public class TypeNumberAudioUnityVolumeAmbient : TypeNumber
    {
        public override double GetPreview(GameObject source) => 1f;

        public override double Get(Args args)
        {
            return VolumeManager.Ambient.Value;
        }

        public override void Set(double value, Args args)
        {
            VolumeManager.Ambient.Value = (float) value;
        }

        public override string ToString()
        {
            return "Ambient Volume";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.Custom;

        protected override Guid OnSubscribe(Action<Args> callback, Args args)
        {
            return VolumeManager.Ambient.Subscribe(callback, args);
        }

        protected override void OnUnsubscribe(Guid subscriptionId)
        {
            VolumeManager.Ambient.Unsubscribe(subscriptionId);
        }
    }
}
```

