Package limn.sound

Class AudioBus

java.lang.Object
limn.sound.AudioBus

public final class AudioBus extends Object
A mixer bus: a named volume group every playback belongs to. The effective volume of a sound is playGain × busGain × masterGain, and bus/master changes apply live to everything already sounding; this is the options-screen "Music volume / Effects volume / Master" model.

Three conventional buses are predefined; of(String) creates additional ones (voice, ambience…). Buses are identity objects: hold and reuse the instance; two of("voice") calls are two distinct buses. Gains live in the AudioEngine (set via Sounds.setBusGain(limn.sound.AudioBus, float)), not on the bus object, so the bus itself is freely shareable.

  • Field Details

    • SFX

      public static final AudioBus SFX
      Sound effects: the default bus of PlayOptions.DEFAULTS.
    • MUSIC

      public static final AudioBus MUSIC
      Background music (long, looping, usually streamed).
    • UI

      public static final AudioBus UI
      Interface feedback beeps/clicks.
  • Method Details

    • of

      public static AudioBus of(String name)
      Creates a custom bus (e.g. "voice"). Keep and reuse the instance.
    • name

      public String name()
      Returns:
      the bus's display name (diagnostics only; identity is the object)
    • toString

      public String toString()
      Overrides:
      toString in class Object