Using Gain? (dB)

(Michael Barth) #1

Hi there!

I’ll start off with my question, how do I take a gain value in decibels and integrate it with FMOD?

To elaborate, I work on a mod that uses the Source SDK. Unfortunately the sound portions are closed source and a bit buggy. So I created a 3D sound entity that uses FMOD as a base, though it does more than 3D sound.

I’ve basically got what I want and have been using it for a couple years now, but Source also has sound levels that it uses for its normal sound system. It has methods that I can use that can compute gain based on a specified decibel level I want to achieve.

Basically I want to take that resulting gain value which is in decibels and apply it to my FMOD sounds. I want the sound entity to closely resemble Source’s sound as much as it can, just without the bugs of course.

But there doesn’t seem to be some built-in way to do this. There is this setLowPassGain function for channels. However according to the documentation this requires lowpass filtering. Which I’ll be honest, I have no clue what this means. I’m unfortunately not a sound engineer. This stuff really interests me though.

Is this what I want? If so, this doesn’t seem to be in decibels, so how would I use it?

Any help and information is greatly appreciated!

(リチャード清水) #2

Hi Michael,

Could you please elaborate on what you are referring to when you say “gain”?

This can be one of the following:

  1. The volume of the 3D Sound or channel you create
  2. The Gain DSP effect
  3. A lot of effect modules use “gain” in terms of volume for the output of that effect or parameter

In the low-level API, gain in any of these scenarios are calculated linearly. This means 0 is -80dB (or silent), and 1 is 0dB. It would be best to avoid going higher than 0dB in case of clipping.

It sounds like you are just wanting to adjust the volume of a 3D Sound, so it would be best to assign the sound to a channel, and adjust the volume of that channel.


(Michael Barth) #3

My bad, I have completely misinterpreted what the Source Engine does. While it refers to sound levels as “decibels”, they are actually representations of attenuation. Oh how I have wasted so much time thinking that this was measured in actual sound pressure.

Anyway. Thanks. I’m just going to reflect on how much time I have wasted looking at code when I could’ve looked at Valve’s wiki and seen that their sound levels are for attenuation.

I am so sorry for wasting anyone’s time.

(リチャード清水) #4

Not a problem, Michael. We’re happy to help any time you need.