Audio

Plays, stops and adjusts the game's sound triggers on this machine only, with nothing sent to others. Each call returns whether the game accepted it. It returns false before a world has loaded, for a name the game's audio data does not have, and for an entity that is not there.

audio.play()

Audio.play(trigger)

Plays a trigger at the local player.

audio.playAt()

Audio.playAt(trigger, position)

Plays a trigger as a free sound at a point in the world.

audio.playFrom()

Audio.playFrom(trigger, entityId)

Plays a trigger on an entity, so it moves with it.

audio.playFile()

Audio.playFile(file, entityId, purpose)

Plays a resource's .ogg file on an entity through one of the game's voice events.

audio.stopFrom()

Audio.stopFrom(trigger, entityId)

Stops one trigger playing on an entity.

audio.silenceEntity()

Audio.silenceEntity(entityId)

Stops all sounds on an entity, including the game's own.

audio.setSoundParameter()

Audio.setSoundParameter(entityId, parameter, value)

Sets one of the game's audio parameters (an RTPC) on an entity.

audio.setSoundSwitch()

Audio.setSoundSwitch(entityId, switchName, state)

Sets one of the game's audio switches on an entity.

audio.triggerExists()

Audio.triggerExists(trigger)

Whether the game's audio data has the trigger.