Page 1 of 1

Audio.SfxVolume Changes Volume of Other Sounds

Posted: Fri Jun 10, 2016 6:38 pm
by Sambo
I set the volume for a certain chunk to be lower when a custom sound effect played because it was too loud, but then OTHER sound effects started to be quieter when they played. Apparently, these audio functions use the same channels as the default sound effects. How can I make it so I can change the volume of custom sounds without screwing with the default sounds?

Re: Audio.SfxVolume Changes Volume of Other Sounds

Posted: Fri Jun 10, 2016 7:32 pm
by Quantumenace
Audio.SfxVolume changes the volume of the channel, not the sound itself. I had similar problems with using fadeout effects; if the player dies and the level reloads during fade in/out the channel volume will stay at a lower volume.

You can modify the volume of a chunk with its .volume field:

Code: Select all

local rocketloopsound = Audio.SfxOpen("rocketloop.ogg")
rocketloopsound.volume = 32
That should change the volume of any playback of the same sound file, even if you call it with Audio.playSFX(string) instead of the chunk variable.