AudioSource.volume Manual     Reference     Scripting  
Scripting > Runtime Classes > AudioSource
AudioSource.volume

var volume : float

Description

The volume of the audio source.

JavaScript
@script RequireComponent(AudioSource)
function Start() {
audio.volume = 0.2;
}

using UnityEngine;
using System.Collections;

[RequireComponent(typeof(AudioSource))]
public class example : MonoBehaviour {
void Start() {
audio.volume = 0.2F;
}
}

import UnityEngine
import System.Collections

[RequireComponent(AudioSource)]
class example(MonoBehaviour):

def Start():
audio.volume = 0.2F