Volume control with the positioned audio

Get help using Construct 2

Post » Thu Mar 14, 2013 10:01 pm

Hello everyone,

I'm very happy about this new feature, the positioned audio. :)
I was waiting for this for a long time.

I made some tests and I can't figure out how to STOP hearing a positioned sound. It seems to never be quiet even if the listener is far far far away from the audio source.
There's no range value or something so, is there a way to control that audio range ?
If not, it's going to be an audio mess!

Thank you!
B
61
S
16
G
12
Posts: 314
Reputation: 11,307

Post » Fri Mar 15, 2013 12:45 am

Yeah we really need some info on how to use it properly, or some picture/diagrams to explain how it all works.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sat Mar 16, 2013 12:02 am

bump
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Fri Mar 22, 2013 4:53 am

bump
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Fri Mar 22, 2013 8:41 am

Bump up the volume :)
B
61
S
16
G
12
Posts: 314
Reputation: 11,307

Post » Fri Mar 22, 2013 8:55 am

Thought it'd be a fun challenge to play around with this, so have a look at what I've come up with:

Example capx. Drag and drop the green circle.

It's in two parts: setting up positional audio to get the left/right channel stuff working, and I used the distance between the sprite and the audio generators to determine their volume.

I tested this at quite low volume. Obviously it'll need tweaking according to your setup, so please start with the volume down low.

I do agree though, an attenuation percentage setting would be brilliant.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Fri Mar 22, 2013 9:23 am

You can increase the roll-off factor in the audio object properties to achieve this effect.

You can also adjust overall ranges here too, but I think we need an option to have custom ranges and roll off factors so that some sounds can be heard at greater distances to others. The way unity handles 3D audio is a good source for inspiration here. You drop in an audio emitter object, assign a sound to it and then set its range / roll-off factor.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Fri Mar 22, 2013 10:23 am

@CrudeMik, wow, thanks for pointing that out. I hadn't noticed that roll-off factor before.

I'd suggest setting the individual volumes for audio that you want to travel further, and setting the roll-off to be low enough to compensate. It'd need some playing with but I think it'd work quite well.

@KaMiZoTo, I've updated my demo to show you the roll-off in action.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Fri Mar 22, 2013 10:54 am

I wonder if there's a way of building an emitter object that uses string variables to call a sound file, set a range, roll-off factor and also pitch.

So you only need to make one emitter object to call all the positional sounds in your game.
B
39
S
12
G
8
Posts: 580
Reputation: 7,108

Post » Fri Mar 22, 2013 12:39 pm

Thank you guys! I haven't seen thoses audio settings. I will test that and see (hear)if it solves my issues. :)

@GeometriX Thanx for the example!
B
61
S
16
G
12
Posts: 314
Reputation: 11,307

Next

Return to How do I....?

Who is online

Users browsing this forum: Aserak2012, ManuelPerez, newt and 21 guests