I’m wondering if anyone have any good input on what is the best practices when it comes to playing audio clips.
I have a sound mixer for my sound FX and I would like every sound FX to be a separate group to have maximum control over all the sounds. I was just curious if I should have one audiosource per sound fx and then link that audiosource to the correct group in the mixer, or should I have one group and keep swapping the audioclip for each sound fx?
Or should I have have a empty game object with just the audiosource linked to the correct group?
What is the standard here, what do people usually do for best result?
I find it messy to swap Audio Sources. That also makes it impossible to schedule clip#2 if you wanted to seamlessly “link” 2 or more clips together. I’d do 1 Audio Source per group.
Yeah maybe you are right. I just have this weird feeling that it’s not the correct way to do it… I kinda feel like the audio mixers are a very nice tool to use but I can’t really wrap my head around how to use them as I should.
Maybe I should dive more deeply into online guides to get a better understanding
As I said, if you want to schedule the 2nd clip.
The OP wants “maximum control” over the sounds. In that case, I’d use a different Source for all clips. Not necessarily a different Mixer Group though, that seems a bit weird to me.
Well for one, it’s simpler that way, coding-wise. Knowing what clips are going to be where at any given time, since they don’t ever “move”. So less debugging if things aren’t working properly.
Also, and this doesn’t have anything to do with your question, but I also completely avoid the PlayOneShot API because then you can’t stop / pause / change volume of any of the OneShotted sounds, only the entire Audio Source. Just something to think about before doing that.
Can’t think of any other reasons right now though.