Class Audio
Audio management class. These set of functions wrap the internal engine audio api and the FMOD api.
Inheritance
System.Object
Audio
Namespace: Chroma
Assembly: Chroma.Mono.dll
Syntax
public static class Audio
Methods
GetEventParameter(String, String)
Get a parameter value of an event.
Declaration
public static float GetEventParameter(string event_name, string parameter)
Parameters
Type | Name | Description |
---|---|---|
System.String | event_name | Name/ID of the event. |
System.String | parameter | Name/ID of the parameter. |
Returns
Type | Description |
---|---|
System.Single |
IsEventPlaying(String)
Checks whether the event is currently playing.
Declaration
public static bool IsEventPlaying(string event_name)
Parameters
Type | Name | Description |
---|---|---|
System.String | event_name | Name/ID of the event. |
Returns
Type | Description |
---|---|
System.Boolean | Playing status. |
PlayEvent(String)
Plays an audio event.
Declaration
public static void PlayEvent(string event_name)
Parameters
Type | Name | Description |
---|---|---|
System.String | event_name | Name/ID of the event. |
PlayEventIfStopped(String)
Plays an audio event ONLY if it is not playing. This function can be used if the playing state of the event us unknown.
Declaration
public static void PlayEventIfStopped(string event_name)
Parameters
Type | Name | Description |
---|---|---|
System.String | event_name | Name/ID of the event. |
SetEventParameter(String, String, Single)
Set a parameter value of an event.
Declaration
public static void SetEventParameter(string event_name, string parameter, float value)
Parameters
Type | Name | Description |
---|---|---|
System.String | event_name | Name/ID of the event. |
System.String | parameter | Name/ID of the parameter to set. |
System.Single | value | Value to set the parameter |
StopEvent(String, Boolean)
Stops an audio event from playing.
Declaration
public static void StopEvent(string event_name, bool immediate = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | event_name | Name/ID of the event. |
System.Boolean | immediate | Whether the event should stop immediately. If not, the event will follow any ending/fading behavior specified. |