Enfusion Script API
Loading...
Searching...
No Matches
AudioSystem Interface Reference

Static Public Member Functions

static proto AudioHandle PlaySound (string resourceName)
 Play *.wav file.
 
static proto bool PlayEventInitialize (string resourceName)
 Preload audio file(*.acp).
 
static proto AudioHandle PlayEvent (string resourceName, string eventName, vector transf[], array< string > names=null, array< float > values=null)
 
static proto bool IsSoundPlayed (AudioHandle handle)
 
static proto void TerminateSound (AudioHandle handle)
 
static proto void TerminateSoundFadeOut (AudioHandle handle, bool fade, float fadeTime)
 Terminates a sound with specific a handle, where fade-out can be applied for a specific amount of time.
 
static proto bool SetSoundTransformation (AudioHandle handle, vector transf[])
 Sets transformation for given audio handle, return FALSE if audio handle is not valid.
 
static proto float IsAudible (string resourceName, string eventName, vector position)
 Returns -1.0 for the inaudible event, otherwise, it returns the distance from the passed position to the listener.
 
static proto float GetDistance (vector position)
 Returns distance to the listener.
 
static proto bool SetBoundingVolumeParams (AudioHandle handle, int volumeType, float params0, float param1, float param2)
 
static proto void Pause (int mastersMask)
 Pauses currently playing sounds and rejects insert new sounds. Use: AudioSystem.Pause((1 << AudioSystem.SFX) | (1 << AudioSystem.VoiceChat))
 
static proto void Resume (int mastersMask)
 Resumes paused sources and allow insertion of new ones.
 
static proto float OutputVolume ()
 
static proto bool SetMasterVolume (int id, float volume)
 
static proto float GetMasterVolume (int id)
 
static proto bool CreateOutputState (string resourceName)
 Returns index of OutputState instance, in case of error, returns -1. There is only one instance of OutputState for the given name.
 
static proto int GetOutputStateIdx (string resourceName)
 Returns index of OutputState for given resource name. -1 in case no instance is found for the given name.
 
static proto int GetOutputStateCount ()
 Returns a total number of instances.
 
static proto int GetOutpuStateSignalIdx (int outStateIdx, string signal)
 Returns the index of the given signal, -1 if the signal is not present.
 
static proto void SetOutputStateSignal (int outStateIdx, int idx, float value)
 Sets signal to the given value in specified OutputState.
 
static proto int GetVariableIDByName (string varName, string resourceName)
 Returns ID of a variable by Name.
 
static proto string GetVariableNameByID (int ID, string resourceName)
 Returns Name of a variable by ID.
 
static proto float GetVariableValue (string varName, string resourceName)
 Returns current value of a variable by Name.
 
static proto float GetVariableByID (int ID, string resourceName)
 Returns current value of a variable by ID.
 
static proto bool SetVariableByName (string varName, float value, string resourceName)
 Returns false if variable does not exist.
 
static proto bool SetVariableByID (int ID, float value, string resourceName)
 Returns false if variable does not exist.
 
static proto void ResetVariables ()
 Resets all applicable values to 0 or default value.
 

Static Public Attributes

static const int SFX = 0
 
static const int Music = 1
 
static const int VoiceChat = 2
 
static const int Dialog = 3
 
static const int UI = 4
 
static const int BV_None = 0
 
static const int BV_Sphere = 1
 
static const int BV_Box = 2
 
static const int BV_Cylinder = 3
 

Member Function Documentation

◆ CreateOutputState()

static proto bool AudioSystem.CreateOutputState ( string resourceName)
static

Returns index of OutputState instance, in case of error, returns -1. There is only one instance of OutputState for the given name.

◆ GetDistance()

static proto float AudioSystem.GetDistance ( vector position)
static

Returns distance to the listener.

◆ GetMasterVolume()

static proto float AudioSystem.GetMasterVolume ( int id)
static

◆ GetOutpuStateSignalIdx()

static proto int AudioSystem.GetOutpuStateSignalIdx ( int outStateIdx,
string signal )
static

Returns the index of the given signal, -1 if the signal is not present.

◆ GetOutputStateCount()

static proto int AudioSystem.GetOutputStateCount ( )
static

Returns a total number of instances.

◆ GetOutputStateIdx()

static proto int AudioSystem.GetOutputStateIdx ( string resourceName)
static

Returns index of OutputState for given resource name. -1 in case no instance is found for the given name.

◆ GetVariableByID()

static proto float AudioSystem.GetVariableByID ( int ID,
string resourceName )
static

Returns current value of a variable by ID.

◆ GetVariableIDByName()

static proto int AudioSystem.GetVariableIDByName ( string varName,
string resourceName )
static

Returns ID of a variable by Name.

◆ GetVariableNameByID()

static proto string AudioSystem.GetVariableNameByID ( int ID,
string resourceName )
static

Returns Name of a variable by ID.

◆ GetVariableValue()

static proto float AudioSystem.GetVariableValue ( string varName,
string resourceName )
static

Returns current value of a variable by Name.

◆ IsAudible()

static proto float AudioSystem.IsAudible ( string resourceName,
string eventName,
vector position )
static

Returns -1.0 for the inaudible event, otherwise, it returns the distance from the passed position to the listener.

◆ IsSoundPlayed()

static proto bool AudioSystem.IsSoundPlayed ( AudioHandle handle)
static

◆ OutputVolume()

static proto float AudioSystem.OutputVolume ( )
static

◆ Pause()

static proto void AudioSystem.Pause ( int mastersMask)
static

Pauses currently playing sounds and rejects insert new sounds. Use: AudioSystem.Pause((1 << AudioSystem.SFX) | (1 << AudioSystem.VoiceChat))

◆ PlayEvent()

static proto AudioHandle AudioSystem.PlayEvent ( string resourceName,
string eventName,
vector transf[],
array< string > names = null,
array< float > values = null )
static

◆ PlayEventInitialize()

static proto bool AudioSystem.PlayEventInitialize ( string resourceName)
static

Preload audio file(*.acp).

◆ PlaySound()

static proto AudioHandle AudioSystem.PlaySound ( string resourceName)
static

Play *.wav file.

◆ ResetVariables()

static proto void AudioSystem.ResetVariables ( )
static

Resets all applicable values to 0 or default value.

◆ Resume()

static proto void AudioSystem.Resume ( int mastersMask)
static

Resumes paused sources and allow insertion of new ones.

◆ SetBoundingVolumeParams()

static proto bool AudioSystem.SetBoundingVolumeParams ( AudioHandle handle,
int volumeType,
float params0,
float param1,
float param2 )
static

◆ SetMasterVolume()

static proto bool AudioSystem.SetMasterVolume ( int id,
float volume )
static

◆ SetOutputStateSignal()

static proto void AudioSystem.SetOutputStateSignal ( int outStateIdx,
int idx,
float value )
static

Sets signal to the given value in specified OutputState.

◆ SetSoundTransformation()

static proto bool AudioSystem.SetSoundTransformation ( AudioHandle handle,
vector transf[] )
static

Sets transformation for given audio handle, return FALSE if audio handle is not valid.

◆ SetVariableByID()

static proto bool AudioSystem.SetVariableByID ( int ID,
float value,
string resourceName )
static

Returns false if variable does not exist.

◆ SetVariableByName()

static proto bool AudioSystem.SetVariableByName ( string varName,
float value,
string resourceName )
static

Returns false if variable does not exist.

◆ TerminateSound()

static proto void AudioSystem.TerminateSound ( AudioHandle handle)
static

◆ TerminateSoundFadeOut()

static proto void AudioSystem.TerminateSoundFadeOut ( AudioHandle handle,
bool fade,
float fadeTime )
static

Terminates a sound with specific a handle, where fade-out can be applied for a specific amount of time.

Member Data Documentation

◆ BV_Box

const int AudioSystem.BV_Box = 2
static

◆ BV_Cylinder

const int AudioSystem.BV_Cylinder = 3
static

◆ BV_None

const int AudioSystem.BV_None = 0
static

◆ BV_Sphere

const int AudioSystem.BV_Sphere = 1
static

◆ Dialog

const int AudioSystem.Dialog = 3
static

◆ Music

const int AudioSystem.Music = 1
static

◆ SFX

const int AudioSystem.SFX = 0
static

◆ UI

const int AudioSystem.UI = 4
static

◆ VoiceChat

const int AudioSystem.VoiceChat = 2
static

The documentation for this interface was generated from the following file: