RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Ambient SoundUI Apps ManagerUI AudioBindings LegendCamera Distance AppDeveloper ConsoleCredits MusicExternal WebSocket ServerFade ScreenGame BlurGameplay App ContainersGrid SelectorLivery EditorMessages DebuggerMessages/Tasks App ContainersMission InfoPolice InfoTop BarUI ModsNavigation Map DataVehicle Paint EditorVehicle Vicinity AppUI Visibility

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE Extensionsui

UI Audio

Plays UI sound effects from a JSON-defined sound class registry.

Plays UI sound effects from a JSON-defined sound class registry.


Overview

ui_audio loads sound class definitions from ui/soundClasses.json on first update, then provides a simple function to play named UI sounds.

Extension path: lua/ge/extensions/ui/audio.lua


Exports (M)

FunctionSignatureDescription
playEventSound(className, eventName)Plays a one-shot UI sound effect by class and event name.
onFirstUpdate()Loads ui/soundClasses.json into the internal sound classes table.

Internals

Sound Classes JSON

The JSON file maps class names to event names to SFX paths:

{
  "button": {
    "click": { "sfx": "event:>UI>Button>Click" },
    "hover": { "sfx": "event:>UI>Button>Hover" }
  },
  "notification": {
    "popup": { "sfx": "event:>UI>Notification>Popup" }
  }
}

Playing Sounds

local function playEventSound(className, eventName)
  local sound_class = M.ui_sound_classes[className] or {}
  local event = sound_class[eventName]
  if event then
    Engine.Audio.playOnce('AudioGui', event.sfx)
  end
end

Sounds play on the 'AudioGui' audio source group.


How It Works

  1. On first update, ui/soundClasses.json is loaded into memory
  2. UI code calls ui_audio.playEventSound("button", "click") to play sounds
  3. The SFX path is looked up and played as a one-shot via Engine.Audio.playOnce
  4. Invalid class/event combinations silently do nothing

Additional Exports

The following exports are available but not yet documented in detail:

  • M.onFirstUpdate
  • M.playEventSound

See Also

  • ui/ambientSound - Ambient Sound Stream Player - Related reference
  • UI Apps Manager - Related reference
  • Bindings Legend - Related reference
  • UI System Guide - Guide

UI Apps Manager

Core manager for UI app discovery, layout loading/saving, and layout versioning.

Bindings Legend

HUD overlay showing contextual input bindings with modifier support, vehicle-specific actions, and auto-fade.

On this page

OverviewExports (M)InternalsSound Classes JSONPlaying SoundsHow It WorksAdditional ExportsSee Also