Unity Audio Containers
A downloadable tool
Unity Audio Containers is an in-progress prototype for a container-based audio logic tool-set, in the form of a Unity package.
The intention with this project is to create a light-weight in-engine solution for Unity Developers that mirrors the most commonly used core feature-sets of audio middleware programs such as Wwise and FMOD, without pulling in heavy external dependencies.
If your project demands a degree of audio complexity that isn't well served by the stock Unity audio tool-set, but middleware solution workflows feel too foreign or complex for your needs, my hope is that this tool will help bridge that gap.
- Play, Stop, Pause, Unpause, and Break Loop functionality
- Arbitrarily deeply nested container logic trees
- Mixing containers of multiple types (clips vs sequence vs random, etc...)
- Audio Source Pooling
- Seamless Looping and sample-accurate scheduling
- Runtime container editing and mixing
- Editor test functions
- Play on Enable
- Looping playback
- Single, sequential, and random container playback
- Repetition avoidance
- Volume mixing and randomization
- Pitch adjustment and randomization
- Pre and post-playback delay
- Weighting of Random Containers
- Delay randomization
- Voice Priority
- Stereo Panning
- Spatial Blending
- Reverb Zone Mixing
- Output Mixer Groups selection
- Mixer Group Inheritance
- 3D Sound Settings on Containers
- Parameters and Switches
- Blend Containers
- Breaking a loop on a looping audio clip marked with the "Play Single Container" attribute will cause the clip to play 'X' times before stopping, where X is the size of the container.
- This package is public domain (Creative Commons Zero) licensed.
- Chaosed0 for assistance with his ScriptableObject Factory Pattern.
- Jason Weimann of Unity3D College for his Object Pooling breakdown.
- Fixed numerous bugs surrounding looping, and refactored a bunch of code.
- Added a Test Number of Playing Instances editor action.
- Download the package and Extract
- Open Unity project and go to Assets < Import Package < Custom Package
- Select CVAudioContainers.unitypackage and Import All
- Place a GameObject in your Scene to be your Audio Source Pooler
- Add the Pool Preparer and Pool scripts to this GameObject
- Drag the PoolableAudioSource Prefab onto the Pool Preparer Prefabs array
- Select an object you'd like to play sounds from and add an Audio Container Player component
- In the CVAudioContainers < AudioContainerObject folder (or any folder of your choosing), right click and select Create < Create Audio Container
- Name the new Audio Container and drag it onto the AudioContainerFactory field on the Audio Container Player component
- Select your new Audio Container and assign any desired audio playback logic.
- Expand the Container List field and select the size of the number of elements you'd like the container to hold
- Assign any nested Audio Containers or Audio Clips to each of the elements, and select the matching Container Type
- From here, your logic should be set up and working properly
- To test, expand the Editor Actions drop-down on the Audio Container Player component and use the Test functions during runtime to preview behaviors
- Actual runtime behaviors are called via the public Play(), Stop(), Pause(), UnPause(), and BreakLoop() functions in the AudioContainerPlayer
- They should be accessible from anywhere that has a reference to the AudioContainerPlayer instance, though may need to be called through the CVAudio namespace
Leave a comment
Log in with itch.io to leave a comment.