(not a bug) Background ambient sound volume

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

(not a bug) Background ambient sound volume

Post 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.
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Bug: Background ambient sound volume

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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?
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Bug: Background ambient sound volume

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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...
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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?
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Bug: Background ambient sound volume

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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...
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Bug: Background ambient sound volume

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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...
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Bug: Background ambient sound volume

Post by Sophia »

That's fine too!
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Bug: Background ambient sound volume

Post 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.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Bug: Background ambient sound volume

Post 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.
User avatar
Sophia
Concise and Honest
Posts: 4239
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: (not a bug) Background ambient sound volume

Post 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. :)
Post Reply