SCRIPTING API / Audio / Audio
Audio
Mixer control: bus volume, mute, low-pass and ducking. Built-in buses are Master, Music, SFX, UI, Voice and Ambience; AudioSource.SetBus routes a source. Calls are no-ops (false/0) without an audio service, for example on the dedicated server.
Kindclass
NamespaceKroys.EngineScripting
Members14
Source
Audio.csDECLARATION
Declaration
Namespace Kroys.EngineScripting.
Declaration
public static class Audio
REFERENCE
Members
Constants
#public const string MasterBus = "Master"The master bus every other bus feeds.
#public const string MusicBus = "Music"The built-in music bus.
#public const string SfxBus = "SFX"The built-in sound-effects bus.
#public const string UiBus = "UI"The built-in user-interface bus.
#public const string VoiceBus = "Voice"The built-in voice bus.
#public const string AmbienceBus = "Ambience"The built-in ambience bus.
Methods
#public static bool SetBusVolume(string bus, float volume)Sets a bus volume (0..4). Returns false when the bus does not exist.
#public static float GetBusVolume(string bus)A bus volume (0 when the bus does not exist).
#public static bool SetBusMuted(string bus, bool muted)Mutes or unmutes a bus. Returns false when the bus does not exist.
#public static bool IsBusMuted(string bus)Whether a bus is muted.
#public static bool SetBusLowPass(string bus, float cutoffHz)Low-pass effect slot of a bus in Hz; 0 disables it.
#public static bool CreateBus(string name, string parent = MasterBus)Creates a user bus under a parent bus (Master by default).
#public static bool SetDucking(string target, string trigger, float duckVolume = 0.3f, float attackSeconds = 0.05f, float releaseSeconds = 0.5f)The target bus ducks to duckVolume while the trigger bus is audible (e.g. Music under Voice).
#public static bool ClearDucking(string target, string trigger)Removes a ducking rule set with SetDucking.
Signatures
public const string MasterBus = "Master" public const string MusicBus = "Music" public const string SfxBus = "SFX" public const string UiBus = "UI" public const string VoiceBus = "Voice" public const string AmbienceBus = "Ambience" public static bool SetBusVolume(string bus, float volume) public static float GetBusVolume(string bus) public static bool SetBusMuted(string bus, bool muted) public static bool IsBusMuted(string bus) public static bool SetBusLowPass(string bus, float cutoffHz) public static bool CreateBus(string name, string parent = MasterBus) public static bool SetDucking(string target, string trigger, float duckVolume = 0.3f, float attackSeconds = 0.05f, float releaseSeconds = 0.5f) public static bool ClearDucking(string target, string trigger)
KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.