Advertisement Jump to content
MiniDarkOF

SFX Sound Expansion in Unity

Recommended Posts

Hello Again,
I'm trying to create a "sound expansion"

The Example:
a nuclear explosion sound has 1000ft of audible sound area
players who is next to the explosion hear it first
players who is far to the explosion will hear after some seconds
when the sound reaches its area limit, it ends with a "fade-out"


The Point:

i already know how to create fade-out sound effect in Unity

know i want to know how i can create this "sound expansion" effect

Edited by MiniDarkOF

Share this post


Link to post
Share on other sites
Advertisement

It sounds like you're looking to introduce Sound Wave Propagation, and i expect a later question will be to introduce the Doppler effect, into your game on Unity.

I expect you will want to do this yourself, however, an asset exists to do this: https://forum.unity.com/threads/propagate-real-time-sound-propagation.339732/ the intro video that ljdp has on the linked forum post shows some insight into the challenges that you're going to face, specifically that unity doesn't (or didn't) spacialize sound well.

As you've already said, you know how to create a 'fade-out', however the Unity Audio Source API does have a bit of a discussion around how distance impacts magnitude of sound, etc. What i don't know, having not experimented with it myself, is if the sound actually propagates or if its simply is instantaneous but quieter.

For example, i dont know if:

a) The sound is delayed in any way to account for the ~344m/s propagation speed (assuming sea level), meaning a listener in the game world 344m away would hear the sound 1 second after the person making it, provided it was sufficiently loud..

or if:

b) The sound is played immediately with a de-amplification/decay curve applied to the sound to account for attenuation of that sound wave over the 344m (to use the same example above).

Hopefully the terms above help you in your searching, and the prior example gives you something to work from.

Share this post


Link to post
Share on other sites

I had a quick look in the docs and there is:

AudioSource.PlayDelayed

Another way of adding the delay manually (reasonably efficiently) would be to give all your sound effects a delay (empty sound) before starting of say 1 second, then write a wrapper around the play sound function to adjust the start time of the clip according to the distance from the listener.

Share this post


Link to post
Share on other sites
On 12/9/2018 at 5:38 AM, Stragen said:

I expect you will want to do this yourself, however, an asset exists to do this: https://forum.unity.com/threads/propagate-real-time-sound-propagation.339732/ the intro video that ljdp has on the linked forum post shows some insight into the challenges that you're going to face, specifically that unity doesn't (or didn't) spacialize sound well.

this asset is actually unavailable on assets store :\
this asset was SO PERFECT but it's navailable now

Edited by MiniDarkOF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!