RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Gameplay AchievementGameplay CityDiscoverForce FieldGarage ModeMarker InteractionParking SystemGameplay Playmode MarkersGameplay PoliceGameplay RallyGameplay Rally LoopGameplay Raw POIsGameplay Skidpad TestSpeed Trap LeaderboardsSpeed Traps and CamerasGameplay StatisticsTaxi Ride SystemTraffic SystemVehicle PerformanceWalking
Rally Audio ManagerRally Camera Path PlayerRally ClientRally Cut CaptureRally EnumsRally Extension HelperRally GeometryRally ManagerRecce ManagerRecce AppRecce SettingsRally Settings ManagerSnap-to-RoadTraffic Exclusion ZonesRally UtilityRally Vehicle CaptureRally Vehicle Tracker

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 Extensionsgameplayrally

Rally Audio Manager

Manages a queue of pacenote audio playback and pauses for the rally co-driver system. Handles sequential playback with breath timing between notes and damage interruption.

Manages a queue of pacenote audio playback and pauses for the rally co-driver system. Handles sequential playback with breath timing between notes and damage interruption.


Constructor

local AudioManager = require('/lua/ge/extensions/gameplay/rally/audioManager')
local am = AudioManager(rallyManager)

Public API

MethodSignatureReturnsDescription
init(rallyManager)nilInitializes with a rally manager reference
resetQueue()nilClears the audio queue and stops current playback
enqueuePacenoteAudio(pacenote, addToFront)nilQueues audio objects from a pacenote
enqueueSystemPacenote(pacenote, addToFront, audioLen)nilQueues a system pacenote (countdown, finish, etc.)
enqueuePauseSecs(secs, addToFront)nilQueues a timed pause between notes
handleDamage()nilInterrupts current playback on vehicle damage
isPlaying()boolReturns true if audio is currently playing
getQueueInfo()tableReturns {queueSize, paused}
onUpdate(dtReal, dtSim, dtRaw)nilPer-frame: plays next queued audio when ready

Internals

FieldTypeDescription
rallyManagerRallyManagerParent rally manager
queuedequeueDouble-ended queue of audio objects
currAudioObjtable/nilCurrently playing audio object

Audio Object Structure

FieldTypeDescription
audioTypestring'pacenote' or 'pause'
pacenoteFnamestringPath to audio file (for pacenote type)
audioLennumberDuration in seconds
breathSuffixTimenumberPause after playback before next note
timenumberTimestamp when playback started
timeoutnumberTimestamp when playback ends

How It Works

  1. Pacenote audio is queued via enqueuePacenoteAudio() which extracts audio objects from the pacenote
  2. onUpdate() calls playNextInQueue() each frame
  3. When not playing, the next item is popped from the left of the dequeue
  4. For 'pacenote' type: plays via Engine.Audio.intercomPlayPacenote, sets timeout = time + audioLen + breathSuffixTime
  5. For 'pause' type: simply waits for the duration
  6. handleDamage() immediately stops current audio if it's not a damage note, clears the queue
  7. isPlaying() checks if the current time is before the timeout

Usage Examples

-- Queue a pacenote
am:enqueuePacenoteAudio(myPacenote)

-- Queue a system note with a pause
am:enqueueSystemPacenote(countdownNote)
am:enqueuePauseSecs(1.0)

-- Check playback state
if not am:isPlaying() then
  -- ready for next note
end

-- Reset on stage restart
am:resetQueue()

Notes

  • Uses dequeue module for efficient push/pop from both ends
  • addToFront parameter allows priority insertion (e.g., for damage interrupts)
  • Audio playback uses Engine.Audio.intercomPlayPacenote (engine-level intercom system)
  • Breath suffix time adds a natural pause between consecutive notes
FunctionSignatureReturnsDescription
M.enqueueDamage()nilenqueueDamage

See Also

  • Rally Camera Path Player - Related reference
  • Rally Client - Related reference
  • Rally Cut Capture - Related reference
  • Gameplay Systems Guide - Guide

Race Start Position

Object class representing a spawn/recovery position in a race path. Stores position and rotation, and provides methods to calculate vehicle placement transforms and teleport vehicles.

Rally Camera Path Player

Plays a cinematic camera path along a snaproad for rally stage preview. Generates a Catmull-Rom camera path from driveline points with configurable height offset, FOV, and playback speed.

On this page

ConstructorPublic APIInternalsAudio Object StructureHow It WorksUsage ExamplesNotesSee Also