Skip to content

Audio

Two-stage plan: today's level-placed BGM/SFX conductor is enough for the demo. The full FMOD path is queued for Gate 3.

AAudioManager (today)

A level-placed actor that runs background music and exposes volume controls. Drop one in each level.

Components:

  • BGMComponent (UAudioComponent) — the actual playback handle.

Auth fields:

  • BGMTracks (TArray<USoundBase*>) — the playlist for this level.
  • StartingTrackIndex (default 0) — -1 means "don't auto-play".
  • bAutoPlayBGM (default true), bLoopBGM (default true).
  • BGMVolume (default 0.5, clamp 0–1).
  • SFXVolume (default 1.0, clamp 0–1) — applies to all 2D sounds globally via the sound class.

API:

  • PlayBGM(TrackIndex), StopBGM, PauseBGM, ResumeBGM.
  • SetBGMVolume(float) / GetBGMVolume.
  • SetSFXVolume(float) / GetSFXVolume.
  • IsBGMPlaying, GetCurrentTrackIndex.
  • PlayNextTrack / PlayPreviousTrack — wrap-around playlist navigation.
  • CrossfadeToTrack(TrackIndex, FadeDuration = 1.0) — driven by UpdateCrossfade ticking on CrossfadeTimerHandle.

State (private):

  • CurrentTrackIndex, bIsPaused.
  • Crossfade state: CrossfadeTargetTrack, CrossfadeProgress, CrossfadeDuration.
  • OnBGMFinished — wired to the audio component's finish delegate; if bLoopBGM, restarts the same track; otherwise advances to the next.

Per-rune SFX

URuneDataAsset carries optional PickupSound, PlaceSound, SplitSound, ActivationSound. The slot and carry component fall back to defaults when these are null:

  • URuneCarryComponent::DefaultPickupSound / DefaultDropSound — used when the carried rune's data asset has no override.
  • ARuneSlot::DefaultSlotPlacementSound — used when the placed rune has no PlaceSound.

Designer rule: only override the per-rune sound if the rune is special. Silence on a data asset means "use the default."

FMOD path (planned)

The Audio Engineer will introduce the FMOD plugin (FMODStudio) and migrate triggers from UGameplayStatics::PlaySound2D / UAudioComponent to FMOD events. The migration shape:

  1. Add FMODStudio to Rephrased_Demo.uproject plugins.
  2. Add the project's FMOD bank to Content/FMOD/.
  3. Replace per-rune USoundBase* fields on URuneDataAsset with UFMODEvent* references (or keep both, gated by a project setting, during the transition).
  4. Replace AAudioManager with FMOD parameter routing — BGM becomes a single FMOD event with state parameters.
  5. Hook FMOD parameters to game state (e.g. tension parameter rises during a sentence activation).

Until that lands, all new audio integrations target AAudioManager and per-data-asset sound fields.

Source files

  • Source/Rephrased_Demo/AudioManager.h
  • Source/Rephrased_Demo/RuneDataAsset.h (per-rune audio fields)
  • Source/Rephrased_Demo/RuneCarryComponent.h (carry defaults)
  • Source/Rephrased_Demo/RuneSlot.h (slot defaults)

Known constraints

  • SFXVolume on AAudioManager sets a global multiplier but the implementation depends on the sound class hierarchy (a designer-side setup). New sounds that aren't routed through the master sound class won't respond.
  • CrossfadeToTrack runs on a timer that advances CrossfadeProgress linearly. No curve. Acceptable for the demo, but will be replaced by FMOD parameter automation.
  • No spatial audio configuration today — every sound is 2D. FMOD migration will introduce spatializer profiles for ambient and proximity-aware events.

Change history

  • 2026-05-08 — Gabriel Li — Added baseline change history section for weekly wiki maintenance.