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

Get help using Construct 2

Post » Thu Jul 11, 2013 5:25 am

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)


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?
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Jul 11, 2013 7:20 am

maybe you can check the distance, then stop it completely

not sure it is the more efficient way though
@Sushin
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
44
S
18
G
18
Posts: 2,108
Reputation: 16,465

Post » Thu Jul 11, 2013 8:25 am

[QUOTE=Aphrodite] maybe you can check the distance, then stop it completely

not sure it is the more efficient way though
@Sushin[/QUOTE]
There isn't a way to do it with 3D sound...?
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Jul 11, 2013 10:12 am

@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
ImageImage
B
66
S
19
G
7
Posts: 815
Reputation: 9,718

Post » Thu Jul 11, 2013 4:49 pm

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.
B
8
S
2
Posts: 40
Reputation: 2,136

Post » Fri Jul 12, 2013 2:42 am

[QUOTE=vtrix] @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[/QUOTE]
Thanks. It's a little rough but that did the trick.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Mon Aug 03, 2015 12:16 pm

http://c2rexplugins.weebly.com/rex_audio_helper.html
no problem ;)
only two years late...
B
3
Posts: 3
Reputation: 181

Post » Sun Jun 26, 2016 11:52 am

vtrix wrote:@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!
Positive, inspiring and jazzy games!



www.crystalgames.space



Enjoy!
B
17
S
8
G
3
Posts: 173
Reputation: 3,453


Return to How do I....?

Who is online

Users browsing this forum: alajajm, LaurenceBedford, pokka, robopunch and 13 guests