Skip to content

adammyhre/Unity-Audio-Pooling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Audio Pooling

SoundPooling

Take control of the sounds in your game by pooling your Audio Sources! Reduce the number of real voices required to play a multitude of audio clips, manage their lifecycle, and enhance performance. Learn how to streamline your audio management and make your game sound fantastic with efficient audio source pooling!

Example Usage

  1. Create a prefab with a SoundEmitter component for pooling.
  2. Add a SoundManager component to a new empty Game Object in your project.
  3. Add an Audio Mixer with at least one channel.
  4. Add a SoundData field with references to an AudioClip and an AudioMixerGroup
[SerializeField] SoundData soundData;

// Cache SoundBuilder for performance
SoundBuilder soundBuilder = SoundManager.Instance.CreateSoundBuilder();

soundBuilder
    .WithRandomPitch()
    .WithPosition(transform.position)
    .Play(soundData);
}

YouTube

You can also check out my YouTube channel for more Unity content.

About

Unity Audio Source Pooling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages