https://github.com/samethope/sound-system
Versatile, efficient and simple audio system for Unity.
https://github.com/samethope/sound-system
Last synced: over 1 year ago
JSON representation
Versatile, efficient and simple audio system for Unity.
- Host: GitHub
- URL: https://github.com/samethope/sound-system
- Owner: SametHope
- License: mit
- Created: 2023-12-21T11:51:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-21T17:43:54.000Z (over 2 years ago)
- Last Synced: 2025-01-23T08:16:21.388Z (over 1 year ago)
- Language: C#
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sound System
Versatile, efficient and simple audio system for Unity.
## Features
- **No Configuration Required:** You don't need to do any configuration before using it, just include the files and you are ready to go.
- **Pooling:** Both relevant gameobjects and coroutines are recycled when needed without destruction or initialization.
- **Custom Component(s):** Ever wondered why Unity's Audio Source component only has the option to play sound on Awake? Yeah me too.
- **Versatile:** With a single Sound scriptable object, configure audio clips, pitch range, cooldown, volume, pooling and more.
- **Mixer Group Support:** Unlike most audio solutions, Sound System supports both Unity's mixer groups and custom volume and pitch settings.
- **Contained:** With its own assembly definition and pooling system, it doesn't clutter your project or increase compile times.
- **Fully Documented:** All code you can access is documented clearly and accurately.
- **Custom Component Icons:** They are pretty cool.
- **Open Source:** The code is open source.
## Setup
1. Get the scripts inside your project, ideally to the `Assets/Plugins/SametHope/SoundSystem` folder.
2. Done.
## Code Usage
```csharp
// Play sounds with Sound scriptable objects (recommended)
SoundMaster.Play(SomeSound);
// Play sounds with Sound scriptable objects at position
SoundMaster.Play(SomeSound, transform.position);
// Play sound with its name
SoundMaster.Play("My Sound Scriptable Object");
// Play sound with its name at position
SoundMaster.Play("My Sound Scriptable Object", transform.position);
// Cache the audio source
AudioSource source = SoundMaster.Play(SomeSound);
// Return a new Audio Source without playing or pooling it
AudioSource mySpecial = SoundMaster.GetSpecial(SomeSound);
// Return a new Audio Source with its name without playing or pooling it
AudioSource myOtherSpecial = SoundMaster.GetSpecial("My Special Sound");
// Stop all playing sounds
SoundMaster.Instance.ActiveSounds.ForEach(tuple => tuple.source.Stop());
// Filter active sounds
SoundMaster.Instance.ActiveSounds.First(soundDataTuple => soundDataTuple.sound.name == "Ambiance").source.Stop();
```
---
## Component Usage


## Sound Scriptable Object


## Automatic Pooling
