• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Can you spam audio_sound_gain?

Kyrieru

Member
I've realized that you can run audio_sound_gain and it will still transition smoothly even if it's being run multiple times as the sound fades.

What is the performance impact with sound functions like this? Are they taxing?
 

Kyrieru

Member
repeat (500) {audio_sound_gain(snd, 0.0001, 5000);}
Let us know :)
I'm not asking people to do it for me, I ask in case someone already knows.
I didn't realize in the past that when I helped people on this forum that I was supposed to scoff and tell them to do it themselves.
 

Kyrieru

Member
It's probably trivial. But that's totally an assumption.
Seems to be. I don't see a tangible difference. I wonder what exactly happens on the back-end when the same function is run twice for it to continue the fade without issue.

Well, either way seems like there's little impact if you do it a few times every step.
 

obscene

Member
I don't know. At first, I thought maybe it's just that you're overwriting values that it will perform later, but then I remember this scenario...

audio_sound_gain(snd,.5,1000); // will fade sound from 1 to .5

audio_sound_gain(snd,0,0);
audio_sound_gain(snd,.5,1000); // will fade sound from 0 to .5

So I would assume your commands will stack up and cost some amount of performance, but again, can't be much.
 
Top