REDNODE / GAME API

AudioSystem

classnative name gameGameAudioSystemnative

extends gameIGameAudioSystem › IGameSystem › IScriptable › ISerializable

The game's audio system, AudioSystem in scripts. Get it with GameInstance.GetAudioSystem(gameInstance).

Properties 2

NameTypeFlags
enemyPingStimCountUint8scriptedprivate
mixHasDetectedCombatBoolscriptedprivate

Methods 49

native func AddTriggerEffect(effectName: CName, label: CName)
public final func AddTriggerEffectIfPlayerNotInVehicleDriverSeat(playerObject: ref<GameObject>, triggerName: CName, triggerLabel: CName)scripted
native func CloseAcousticPortal(object: ref<GameObject>)
native func EquipNewFootwearByPlayer(itemID: ItemID)
native func EquipNewOutfitByPlayer(itemID: ItemID)
native func GetLeftTriggerState() -> InputTriggerState
native func GetMeleeChargedAttackMinimumValue(configName: CName) -> Float
native func GetPlaylistCurrentSong(playlistName: CName) -> CName
native func GetPlaylistSongs(playlistName: CName) -> array<CName>
native func GetRightTriggerState() -> InputTriggerState
native func GlobalParameter(parameterName: CName, parameterValue: Float)
public final func HandleCombatMix(localPlayer: ref<GameObject>)scripted
public final func HandleDynamicMixAreaEnter(localPlayer: ref<GameObject>)scripted
public final func HandleDynamicMixAreaExit(localPlayer: ref<GameObject>)scripted
public final func HandleOutOfCombatMix(localPlayer: ref<GameObject>)scripted
native func IsInScanningMode() -> Bool
private final func IsPlayerInVehicleInDriverSeat(playerObject: ref<GameObject>) -> Boolscripted
native func NotifyGameTone(eventName: CName)
protected final cb func OnGameEnd() -> Boolscripted
native func OpenAcousticPortal(object: ref<GameObject>)
native func Parameter(parameterName: CName, parameterValue: Float, opt entityID: EntityID, opt emitterName: CName)
native func Play(eventName: CName, opt entityID: EntityID, opt emitterName: CName)

Plays a sound event by name. With no entity and no emitter, it plays a 2D sound, which is how UI sounds are played. Works at the main menu too, because no player is needed.

// redscript
GameInstance.GetAudioSystem(gameInstance).Play(n"ui_menu_onpress");
// REDnode overlay app
await window.rednode.call('audio.play', { name: 'ui_menu_onpress' });

entityID and emitterName are optional, so the event name alone is enough. The REDnode call was tested in game; the redscript line follows the signature but has not been compiled in a test yet.

Names confirmed in game on 2.31 (2026-10-11): ui_menu_onpress, ui_menu_hover, ui_menu_tutorial_close, ui_loot_take_all, ui_menu_item_bought, ui_jingle_quest_success. An unknown name plays nothing and raises no error. See Overlay apps.

native func PlayImpact(impactContext: CName, position: Vector4, object: ref<GameObject>)
public final func PlayItemActionSound(action: CName, itemData: wref<gameItemData>)scripted
private final func PlayItemLootedSound(itemData: wref<gameItemData>)scripted
public final func PlayLootAllSound()scripted
native func PlayOnEmitter(eventName: CName, entityID: EntityID, emitterName: CName)
native func PlayShockwave(shockwaveType: CName, position: Vector4)
native func RegisterEnemyPingStim(enemyState: gamedataNPCHighLevelState, isPoliceman: Bool)
native func RegisterPreventionHeatStage(preventionHeatStage: Uint8)
native func RemoveAllTriggerEffects()
native func RemoveTriggerEffect(label: CName)
native func ReplaceTriggerEffect(effectName: CName, label: CName, opt createIfNotPresent: Bool)
native func ReplaceTriggerEffectMode(id: Uint16, effect: CName)
native func RequestSongOnPlaylist(playlistName: CName, songName: CName)
native func RequestSongOnRadioStation(stationName: CName, songName: CName)
native func RevertTriggerEffect(label: CName)
native func SetBDCameraListenerOverride(value: Bool)
native func SetInScanningMode(inScanningMode: Bool)
native func SetTriggerEffectMode(effect: CName) -> Uint16
native func SetTriggerEffectModeTimed(effect: CName, time: Float) -> Uint16
native func State(stateGroup: String, state: String)
native func Stop(eventName: CName, opt entityID: EntityID, opt emitterName: CName)
native func Switch(switchName: CName, switchValue: CName, opt entityID: EntityID, opt emitterName: CName)
native func TriggerFlyby(position: Vector4, direction: Vector4, startPosition: Vector4, object: ref<GameObject>)
native func UnequipOutfitByPlayer(itemID: ItemID)
native func UnsetTriggerEffectMode(id: Uint16)
native func UpdateTriggerEffectFrequency()
native func VoIsPerceptible(entityId: EntityID) -> Bool