Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Sound propagation

Discussion in 'Works In Progress - Archive' started by diegzumillo, Mar 19, 2014.

  1. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    Hi all

    I'm working on a game that is a bit ambitious to tackle directly, so I broke the project into smaller segments. Sound propagation is one of these pieces.

    There isn't much to say about it, I could go into details of how I'm doing this if anyone's interested.

    Here's the current progress:



    Understanding the video requires some imagination :p The white floor represents a room and the little spheres represent doors. Also, the blue cube is the player and the red cube is the source of the sound.

    There is a lot of work ahead but the bare bones of the system seems to be fully working.
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,663
    Very cool. Inspires me...
     
  3. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    Thanks :)

    Soon after uploading that video I changed the falloff to exponential and it sounds much, much better. Linear falloff always seem to cut too suddenly.
     
  4. mian1024

    mian1024

    Joined:
    Feb 9, 2014
    Posts:
    21
    Cool. Are you moving the audio source to the nearest door opening? How do you handle the combined distance attenuation?
     
  5. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    Not really. That was my first idea but I could see that it would fail in some scenarios involving more doors. I'm actually using 2d sounds and changing the left and right channels according to the direction received from the doors in the listener's room.

    For now, it uses two sound sources, one for each channel. Unity doesn't give me access to that yet, but Unity 5 apparently comes with a whole set of tools for audio. That's great new for this little project :)
     
  6. mian1024

    mian1024

    Joined:
    Feb 9, 2014
    Posts:
    21
    Yeah. Looking forward to read about the details of the Unity 5 audio. :)
     
  7. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    [video=youtube_share;g29Gz-cF9yI]http://youtu.be/g29Gz-cF9yI

    Made some improvements. Room transition, better falloff etc. Also, the video doesn't require so much imagination anymore :p it has walls and all.

    I'm wondering, is there any interest in something like this? for selling on the asset store, I mean. I can see shooters making use of this. It would be a nice way to fund my unity pro :D without unity pro the project won't ever leave the ground unfortunately.
     
    Last edited: Mar 21, 2014
  8. Eqric

    Eqric

    Joined:
    Jun 29, 2012
    Posts:
    51
    Nice work :) I am planing on making something similar :)
    What equation did you use for frequency amplitude decrements over distance?
     
  9. diegzumillo

    diegzumillo

    Joined:
    Jul 26, 2010
    Posts:
    418
    Cool! :)
    I'm not changing the frequency, but the amplitude decays exponentially with distance. I tried linear but it sounds terrible. But in fact linear has its place too, on more subtle sounds.
    If I can help you with anything let me know.