Group and single gain

Hello, I have another question about sounds.
So, for example, I have a group - “ambient” and a sound - “amb1” which is member of same group (“ambient”).
Then, I set

sound.set_group_gain("ambient",  0.5)

and then I do this :

sound.play("amb1",  {gain = 1})

As far as I can hear “amb1” sound will be playing with 0.5 gain, am I right ?
Can anyone explayn how this “gains” work?

Each sound is mixed with the gain it has, into the group sound buffer.

Afterwards, that group sound buffer is mized into the master buffer:

1 Like

Sorry, but this explain nothing to me.
Can you give some simpler version?)

All sounds belonging to the same group are mixed into the same sound buffer. When they are mixed into the group their gain is applied.

The sound buffers (one per group) are then mixed into the main sound buffer. When a group is mixed into the main buffer the group gain is applied.

So a sound with gain 0.5 mixed into group A which has gain 0.2 will end up with a final gain of 0.5*0.2=0.1

1 Like

Thank you!