🟧
Sounds Good Documentation
English
English
  • Welcome!
  • FIRSTS STEPS
    • Create your first sound
  • Create and use audio outputs
  • Included Prefabs
  • Update from 1.0 to 2.0
  • DOCUMENTATION
    • Assemblies and Namespaces
    • Prefixes
    • Audio objects
      • Sound
        • Properties
        • Methods
      • Music
        • Properties
        • Methods
      • Playlist
        • Properties
        • Methods
      • DynamicMusic
        • Properties
        • Methods
    • Editor windows
      • Audio Creator
      • Audio Collection
      • Output Manager
    • SoundsGoodManager
  • Extras
    • Credits
    • Acknowledgments
Powered by GitBook
On this page
  • 🧰 Key concepts
  • πŸ”„ Recommended lifecycle
  • πŸš€ Next step
  1. DOCUMENTATION

Audio objects

Audio objects are instances you create from code to play the sounds or music you previously registered in Audio Creator. Each class encapsulates specific rules and behaviours and offers a fluent, method-chaining API.

Object
What it represents
Typical use

Sound

A single SFX (footstep, shot, UI click…) that might play many times.

Any kind of sound effect.

Music

One music track (ambient, boss theme…) that can loop.

Constant background music.

Playlist

A sequential queue of tracks; plays in order, supports shuffle, fade-in/out and per-track callbacks.

Background music made of several tracks in succession.

DynamicMusic

Several tracks playing in parallel, letting you add/remove layers (drums, strings, SFX) according to gameplay.

Reactive dynamic music.

🧰 Key concepts

  • Fluent API – Every setter returns the same instance, so you can chain configuration and the final Play() in one sentence.

  • Automatic Object Pooling – Internally, each object requests a SoundsGoodAudioSource from the pool, avoiding runtime instantiation.

  • Callbacks (OnPlay, OnComplete, etc.) – Hook gameplay logic (screen shake, particles, achievements) without coroutines or Invoke.

  • Volume persistence – If you assign an Output, its level is saved to PlayerPrefs; Output Manager restores it on start-up.

πŸ”„ Recommended lifecycle

  1. Create

    var coinSound = new Sound(SFX.Coin).SetVolume(0.7f);
  2. Play / control

    coinSound.Play();
    coinSound.Pause();
    coinSound.Resume(0.5f); // 0.5-second fade-in
    coinSound.Stop(0.2f);   // 0.2-second fade-out
  3. Finish

    • When it ends (OnComplete), the object returns its AudioSource to the pool.

    • The class instance stays alive; you can reconfigure it and call Play() again.

πŸ“ Tip: Don’t instantiate an audio object every frame; keep references if you’ll reuse the same SFX (footsteps, rapid fire, etc.).

πŸš€ Next step

Dive into each audio object to master every feature:

PreviousPrefixesNextSound

Last updated 16 days ago

Sound

Music

Playlist

DynamicMusic