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

var priority : int

Description

Sets the priority of the AudioSource

Unity is virtualizing AudioSources, when there's more AudioSources playing than available hardware channels. The AudioSources with lowest priority (and audibility) is virtualized first. Priority is an integer between 0 and 256. 0=highest priority, 256=lowest priority

JavaScripts
// occlude this sound if we dont have hardware resources to virtualize it

audio.priority = 256;

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
audio.priority = 256;
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
audio.priority = 256