Add the ability to instantiate Audio Source Prefabs Request

nathanj

Active member
Hi Justin,

How would you feel about being able to instantiate Audio Source prefabs for specific audio events that are managed by UCC?

For example, with footsteps, UCC looks for existing Audio sources on the specific game object and duplicates them (character's toes in this case). This is good, but if I want to replicate the same behaviour across all NPCs and characters I need to edit the audio sources on both feet for each. If I could just assign a single prefab object to all feet this would be much easier - esp. when you make changes.

Likewise, the 'Jump' sound looks for any Audio Source on the root of the character and if it exists it is player through that. This causes problems if say you use something like Salsa Suite which by default also has an Audio Source on the root of the character (and most likely set to something like a "Dialogue" channel in the mixer).

I feel that some type of addition to the audio mixer that lets you instantiate prefabs of audio sources would be a great way to better manage audio within UCC.

Let me know if you would like me to clarify this more.

Thanks as always,
Nathan
 
Last edited:
This sounds like a good idea. I'll be honest and say that I haven't used the Audio Mixer before so I need to dig deeper into that before I am able to say much more.
 
I don't think you would need to worry about the Audio Mixer from your end. Also, users wouldn't even need to route the audio to the mixer to benifit from this, though it is a nice addition.

However, if you have any questions about the Audio Mixer feel free to send them along, audio is something I can help with.

Thanks for considering this,
Nathan
 
I see the confusion above.

When I wrote
I feel that some type of addition to the audio mixer that lets you instantiate prefabs of audio sources would be a great way to better manage audio within UCC.

I meant
I feel that some type of addition to the audio manager that lets you instantiate prefabs of audio sources would be a great way to better manage audio within UCC.
 
I see, makes sense now. Just so I understand the entire situation, wouldn't prefab variants help solve this?
 
You mean prefab variants of NPCs and Characters? Yeah, it does help a bit - with footsteps, for example. It's what I'm using at the moment. However, this doesn't resolve the issue of the audio sources on the root of the character or the ability to assign different mixer channels to different audio sources.
I think that the ability to instantiate audio components or some global way of managing audio sources within the UCC framework would be a more user feindly solution.
 
To tag along on this, the docs are a little confusing here.

If you add an Audio Source to your GameObject the Audio Manager will use the properties from that Audio Source automatically.

That sounds ideal to me, because all I really want is for the UCC sounds to be routed through my audio mixers instead of playing at max volume. But, I've tried adding Audio Sources to my character root, to items, to his feet, to Surface objects, etc. and setting them to my audio mixers. Nothing seems to get the Audio Manager to use my Audio Mixers.

I'm not looking for any big changes to how UCC handles audio, I'd just like it to actually pull the properties from my Audio Sources. Some sort of documentation about where it pulls Audio Sources from would be nice too. Otherwise I'm using trial and error to try and discover where it would play impact sounds, surface effects, item Use audio, etc.
 
Did you guys ever come to a conclusion about this? Since the controller adds AudioSources to the weapons for example, its impossible to set the mixer properly and there for the audio is at 100% for the player all the time. Is there any work around to this?
AudiomixerNone.PNG
 
My understanding is that this is something that is currently being worked on and should be available in the 2.4 update. They are working towards a scriptable object solution for audio sources that will give proper control to unique audio source settings.

I can not wait until it’s available, it’ll be a massive help for customisation.
 
When I experimented with this I think I might have come up with a very quick and dirty fix for this.
If you attach a empty AudioSource to the gameobject that receives AudioSources during runtime, and set the self added AudioSource to the prefered mixer: All other runtime AudioSources gets the assigned mixer.

Feel free to confirm If this also works in your projects!
 
This works as long as all the audio files are intended for the same audio mixer channel.

But, when audio sources are played through the same game object (dialogue, hits, etc) are meant for different channels it becomes a problem.

The benefit of having channels is being able to attenuate certain audio types rather than editing the original audio courses.
 
This works as long as all the audio files are intended for the same audio mixer channel.

But, when audio sources are played through the same game object (dialogue, hits, etc) are meant for different channels it becomes a problem.

The benefit of having channels is being able to attenuate certain audio types rather than editing the original audio courses.
Exactly you are completly right! I make it easy for me and set everything to the mainMixer and then this "solution" I mentioned work for now.
Really looking forward to a proper Audio system in the controller!
 
Top