Forum rules - please read before posting.

Spatial Blend with Ambience

Hi everyone,
I set up spatial blend on a sound with audiosource in my scene, so that the sound is louder when my camera is nearer to the audio source. That is setup and working. BUT I'd also like it to smoothly transition/crossfade into the sound playing in the next scene (which also uses spatial blending), without a pause in sound during the scene change.

Let's say the first scene plays a 'Waterfall' sound and the second sound plays 'Jungle' sound.
To get the crossfade between scenes, I placed the two sounds into 'Ambience storage' and crossfaded it as an ambient sound on scene start. I then had the crossfade I wanted, but have lost the spatial sound (which was originally part of an audiosource attached to an object in my scene).

  • Is it possible to have an audiosource/spatial sound settings available for an ambient sound?
  • Or can I crossfade the sound playing from a scene object (or prefab?) with an audiosource, rather than using ambience?

Thank you in advance for any help.

Comments

  • It's possible to access the Ambience audiosource through scripting to set the spatial blend with:

    AC.KickStarter.stateHandler.GetAmbienceEngine().audioSource.spatialBlend
    

    The issue is that (presumably) it'll need to be coming from a different relative position in the scene.

    Or can I crossfade the sound playing from a scene object (or prefab?) with an audiosource, rather than using ambience?

    If you make a prefab out of a new Sound object, attach the Survive scene changes Action, and use the Object: Add or remove Action to spawn it in when your game begins via the Event Manager's Scene / On Begin Game event.

    That should allow you to then control playback across all scenes.

  • Thank you Chris, this did work nicely.

    The problem then was that when the sound was carried over to the next scene, the volume would jump on scene change (as well as the LR balance) because of the position of the sound relative to the camera in the new scene vs the previous scene.

    I tried teleporting the sound to roughly the correct position on the new scene load but could not achieve accurate results (I may have done with more patience).

    In the end I've decided to go back to the ambient waterfall sound playing without spatial sound, as well as a spatial sound source in the scene (playing a slightly different sound clip to the ambient one) to make it louder when nearer the source, and that sound is set to drop out before the player reaches the exit of the scene, so doesn't need to persist over scenes.

    Thanks again, Mike

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.