How to make sound fade away w/ 3D sound?

0 favourites
  • 8 posts
From the Asset Store
Template for a basketball game with a 3D aspect (illusion of 3D)
  • Hi guys. I'm trying to get an effect where a sound will disappear if you get far away from it but I don't really understand how the sound works in construct.

    This is what I'm doing now and it works to a degree, but the sound never fades out entirely (maybe its because i'm not going far away enough but I need it to fade out from less distance)

    <img src="http://puu.sh/3A1mZ.png" border="0" />

    Also, I did set a listener object. The sound DOES fade, but I need to get it to fade out entirely after a distance of say 2000 pixels. What should I do here?

  • maybe you can check the distance, then stop it completely

    not sure it is the more efficient way though

    Sushin

  • maybe you can check the distance, then stop it completely

    not sure it is the more efficient way though

    Sushin

    There isn't a way to do it with 3D sound...?

  • Sushin

    just multiply the set volume with the distance of the 2 sprites (every tick)

    if you started the sound with 3d effect it will remain 3d but with the added soundfading

    example set volume

    -10*distance(Sprite2.X,sprite2.Y,Sprite.X,sprite.Y)/100

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Or you could try clicking on the Audio object in your project's object list on the right and play with Audio plugin properties on the left.

    I'm mostly looking at the the 3 main things

    • Distance model: how it calculates the volume reduction over a distance I suppose;
    • Maximum distance: How far the volume will reduce before it stops reducing; and,
    • Roll-off factor (probably what you're looking for: how quickly the volume is reduced as the source moves away.
  • Sushin

    just multiply the set volume with the distance of the 2 sprites (every tick)

    if you started the sound with 3d effect it will remain 3d but with the added soundfading

    example set volume

    -10*distance(Sprite2.X,sprite2.Y,Sprite.X,sprite.Y)/100

    Thanks. It's a little rough but that did the trick.

  • http://c2rexplugins.weebly.com/rex_audio_helper.html

    no problem <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink">

    only two years late...

  • Sushin

    just multiply the set volume with the distance of the 2 sprites (every tick)

    if you started the sound with 3d effect it will remain 3d but with the added soundfading

    example set volume

    -10*distance(Sprite2.X,sprite2.Y,Sprite.X,sprite.Y)/100

    Thanks for the formula!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)