Manual     Reference     Scripting  
  
Scripting > Runtime Classes > AudioClip Switch to Component   
  • Menu
  • Overview
  • Runtime Classes
  • Attributes
  • Enumerations
  • Editor Classes
  • Enumerations
  • History
  • Index
  • AudioClip
  • All Members
  • Variables
  • channels
  • frequency
  • isReadyToPlay
  • length
  • samples
  • Inherited Variables
  • hideFlags
  • name
  • Inherited Functions
  • GetInstanceID
  • ToString
  • Inherited Class Functions
  • Destroy
  • DestroyImmediate
  • DontDestroyOnLoad
  • FindObjectOfType
  • FindObjectsOfType
  • Instantiate
  • operator !=
  • operator ==
  • operator bool

AudioClip.channels  

var channels : int

Description

Channels in audio clip (Read Only)

JavaScripts
// Prints how many channels the attached audio source has
// 1 --> Mono
// 2+ Stereo
Debug.Log(audio.clip.channels);

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
void Awake() {
Debug.Log(audio.clip.channels);
}
}

import UnityEngine
import System.Collections

class example(MonoBehaviour):

def Awake():
Debug.Log(audio.clip.channels)