Is there a drawback when using multiple AudioSources instead of PlayOneShot

I implemented custom audio manager to handle characters sounds.
Currently I’m using PlayOneShot but as I understand you cannot set pitch. Also Stereo Pan would be a cool option.
As a solution I want to pool AudioSources and play sounds on them.
Is there a drawback to this? What if I will have like 100 of them?

And related question.
Are all active audio sources + PlayOneShots counted towards voices?
E.g. if I have 2 AudioSource playing on a unit and 3 PlayOneShots from different AudioSource it will be 5 voices, correct?
Is PlayClipAtPoint counted as a separate voice?

1 Like

PlayOneShot is a nice “fire-and-forget” but I would certainly encourage you to go forward with an AudioSourcePool design! It’s a great way to keep an eye on memory, accelerate sound instanciation and like you said, offers a decent amount of features!

I don’t there are any relevant drawbacks to this approach, if you have specific concerns, feel free to share them.

And to your questions:

Yes! “Voice” refers to an active (and generally audible) instance of a sound being played, no matter how it was triggered.

Also yes. This will basically create a temporary AudioSource at the targeted location.

1 Like