Forum rules - please read before posting.

Parent Sound Object Triggering

edited December 2017 in Technical Q&A
Hey all - 

I'm starting in on the final audio pass for my game and wondered if there was an existing/easy way of starting/stopping mass amounts of sound objects with one action.  I have several positional 3D sounds in my scene to create a nice/evolving surround soundscape. I'd like to fade all of those in along with a 2D bed at load without having to do a fade-in action on each individual sound object.  In addition to that; I'll need to transition those sounds into a different set when hitting a trigger to go into an underground chamber in the same scene.

Is there a way of having a parent object that I could trigger to fade everything in that parent in/out with one action?  

I looked at the the Audio Mixer Groups.  That seems to still start the sounds at full volume at the very beginning of load and then transitions to the mixer snapshot after that...so you get this big blast of noise when you first load a scene and then it goes to your snapshot setting.  I've also looked at the Ambience Storage Window but that's still unwieldy for mass amounts of sound objects editing at once.

I'd love a one action method of doing this...or maybe even just have a component on each audio source that does a fade-in on "play awake"...although the parent object triggering is vastly preferred.

Any ideas?

Thanks!
-z

Comments

  • Sorry, it doesn't work like that.  But I think Audio Mixer Groups would be the best-practice way anyway.

    You could try doing it with Audio Mixer Snapshots - the Sound: Set Mixer snapshot allows you to fade from one to another over time.
  • Okay, thanks.  I'll figure something out.  Yeah, I've been working with Audio Mixer Snapshots but I'm still getting a pop of noise on scene load.  I've lessened it by setting the default mixer setting to complete silence and transitioning to another snapshot on every scene load, but still getting a small pop of noise. 

    Investigating a component that would fade every audio source in by a small amount that's set to "Play Awake".
  • Is the "popping" due to low SFX/Music levels in the AC options menu?  That's cropped up before in the past.
  • I'm definitely seeing that.  I have music turned all the way off while I test the ambient sounds and it often starts at a high level and then immediately goes to mute.  SFX levels are up pretty high, though.
  • OK.  And are you using the dedicated Music system/Action to play music?  It may not be possible to "catch" the volume if you use the AudioSource component's Play On Awake option, but should be if you're using the Sound: Play music Action in your OnStart Cutscene.
  • I haven't moved over to the music system yet as I don't have final assets, so once I get the final deliverable from the composer and do my implementation pass; I'll revisit the music volume issue.  I am currently using actions to trigger the temp music (not Play On Awake)...but it's the old method of doing so before you added the Play Music option.

    Yeah, I was concerned that the Play on Awake option might be causing pain for the ambient sounds.  If I can't find a quality workaround, I'll do another sweep through all of my scenes and move things over to being faded in on the OnStart Cutscene.  It's just time consuming because I have upwards of 30 3D emitters in some of my bigger scenes and a total of 59 scenes in the game; so I'm just looking for ways to cut corners a bit.
  • I'd definitely recommend moving to the music system when you can, as it should make the management of music playback must easier and may also fix the volume issue.
  • Okay cool, I'll take a look when I get there.

    In regards to the audio mixer snapshot transition...is that on a particular curve?  Is it just linear?  I ask because I was doing some tests where I use the Fade In Sound action with the same time values as an actor mixer snapshot transition and the Fade In Sound action feels much smoother.
  • I'm not sure - it's actually relying on TransitionToSnapshots method so it's internal to Unity.
  • edited December 2017
    Gotcha.  Then they are probably doing something silly.  ;-)

  • Yet another dumb question from me.  Is there any way to set a mixer snapshot transition on a loading screen? I know you can't run actionlists from a loading screen by default, but wondered if there would be a simple method of triggering a mixer snapshot transition when the loading screen first loads.  I think I have workarounds for starting new games and loading saved games, but I'd like to do this automatically through the load screen so I don't have to touch every single scene transition in the game.

    Any pointers? 
  • Actually - I got something to work.  Wrote a quick script that changes the audio mixer snapshot to silent at runtime and put it in the loading screen scene.
  • Also, just as a heads-up, the user can change the curve that you use when you are transitioning to a different audio mixer snapshot.  It has to happen at the audio mixer level.  Select one of your group faders, go over to the inspector, right-click on "Volume" and it'll give you several options.  It defaults to Linear.

    image

    You can also change the transition time scale to either operate hand in hand with the game's current timescale or you can decouple it and run it as "unscaled".  Select the parent Mixer and look in the inspector window.  You'll see "Update Mode" defaulting to "Normal" (Game Timescale) and you can select "Unscaled":
    image

    Hopefully, I got all of this figured out!
  • Good to know about those transition options, thanks!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.