Page 1 of 1

(not a bug) Background ambient sound volume

Posted: Sun May 06, 2012 3:41 pm
by Gambit37
There's a weird thing going on with background sounds: they are temporarily lowered when other sounds play (such as throwing an item, swinging a weapon, a door opening, etc.) When the other sounds have all stopped, the background sound returns to full volume.

It's quite subtle and I didn't notice at first using speakers, but it's more obvious when listening on headphones.

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 8:14 pm
by Sophia
To be honest, I don't even notice anything, even with headphones.
In any case, it is probably just how the FMOD mixer works, so there isn't really anything I can do about it.

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 8:21 pm
by Gambit37
Do background sounds have a special identifier that is picked up by my sound hardware? Could it be anything to do with my sound drivers?

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 8:26 pm
by Sophia
What do you mean by "background sounds"?

To the game engine, there are three types of sounds:
2d sounds: Triggered via dsb_sound
3d sounds: Triggered via dsb_3dsound
Music: Triggered via dsb_music

There are no distinct types of sound beyond these, and all sounds fall into one of these three categories.

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 8:31 pm
by Gambit37
These are ambient loops I'm playing when I enter a level, using dsb_sound. I'll see what happens if I do it as music, just to see what the FMOD mixer is doing...

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 9:04 pm
by Gambit37
I checked my code and I'm already using dsb_music to play those loops. So I instead set them up as 2D sounds but the problem is exactly the same. Could it be to do with the number of available channels for FMOD to use -- how many does DSB set up?

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 9:20 pm
by Sophia
FMOD has this thing called "Virtual channels" that I think is supposed to mean you don't have to worry about that.
But anyway, DSB sets up 40 channels.

Re: Bug: Background ambient sound volume

Posted: Sun May 06, 2012 9:24 pm
by Gambit37
I guess this is something that could take ages to track down and fix, and I sense that you're not keen on that ;-) I will have to try an un-hear the effect so that I remain unaware of the problem :D

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 2:39 am
by Gambit37
Hmmm.... I can't un-hear this, especially as I'd like to use footstep sfx on party movement. The background sound volume is constantly wobbling up and down as the party move about, it's actually really obvious and very distracting. Is this something you'd be able to look into? I've googled for obvious search terms but haven't found anything useful yet...

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 4:05 am
by Sophia
I'm not sure what I can do, but if you'll send me a dungeon that illustrates the problem, I can look at it.

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 4:44 am
by Gambit37
OK. I'm still having trouble with the whole compiling thing, so it may have to be a big zip of uncompiled assets...

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 6:15 am
by Sophia
That's fine too!

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 12:31 pm
by Gambit37
I made a tiny dungeon which shows the effect, grab it here:
http://matthill.co/f/dsb/soundvol_dungeon.zip

However, doing some research, maybe what's going on is "Ducking" - FMOD is lowering one sound while playing another one at full volume:
http://www.gamasutra.com/view/feature/3 ... hp?print=1

Is this something you have any control over in your engine, ie, can you change the priorities of different types of sounds? Maybe this is also why skeletons and stuff sounds too loud?

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 3:29 pm
by Paul Stevens
I'll poke my nose into something I know
nothing about....

Perhaps the mixer is attempting to prevent
clipping. If you have two sounds, each at
maximum 'volume', and you mix them together,
you will cause clipping. Because you add the
sample values.

I'd check the sample values of your sounds.
If they are greater than 0.5 of maximum, I'd
try reducing them to 0.5. Then it depends on
how clever your mixer is. Perhaps it blindly
divides by two. If that is the case, then you
would have to supply a fake, 'silent' sound
whenever there is no ambient sound. But
I would hope the mixer would have an option
to mix the sounds without modification.

The hardware might even have a 'auto-volume'
control that prevents clipping.

Re: Bug: Background ambient sound volume

Posted: Mon May 07, 2012 4:53 pm
by Gambit37
Yes, I think you're right. I lowered the volume of some of the sound effects by about half and now the background sounds barely change volume at all.

So it looks like the solution is just to make sure that I balance the relative volumes of all the FX. This is fine, I can do that in my sound software.

Re: (not a bug) Background ambient sound volume

Posted: Mon May 07, 2012 7:19 pm
by Sophia
I have tagged this "not a bug" based on the discussion in this thread.
If you think that something is still wrong, please let me know. :)