Hi, I’ve set up VCAs in Fmod but I’m confused about what values I use to control the VCA volume. I tried feeding it -80 to 0, which was very wrong. -80 was super distorted! So I tried 0-9, which was closer, but still confusing. Is there a guide to how values are mapped?
While FMOD Studio displays volumes in decibels, the FMOD Engine instead uses multipliers: A volume property set to 1 will result in the signal’s volume being unchanged; a volume property set to 0 will cause the signal to be reduced to silence, a volume property of -1 will cause the signal to be inverted, a volume property of 1.1 will cause the signal’s amplitude should be increased a little, and so on.
The scale of valid volume property values is technically open-ended, meaning it can be any real number, positive or negative. In practice, however, you will almost always want to set volume to a value between 0 and 1, as values above 1 can easily result in distortion and values below 0 are are only useful if you need to invert the signal for some reason.
(Setting the VCA to -80 would both invert the signal and cause it to play it at many times its normal volume. It’s not surprising the output was distorted.)
Information on how volume properties work in the FMOD Engine can be found in the FMOD Engine User Manual, but it’s buried in the Core API Reference and so easy to overlook. I’ll add a task to our tracker to improve the visibility of this information.
Ok thanks, I’m still a little confused by what you mean by :
From the manual I see “0 = silent, 1 = full.” Does this not mean that 0 is directly mapped to silence and 1 mapped to +10db?
This appears to work for me, as 0.8 sounds like 0db? My user input volume slider outputs from 0 to 0.8 and seems to function as expected (from silence to 0db). If I set the VCA volume to 1 it sounds like +10db.
No, it means that 0 is mapped to silence and 1 is mapped to 0 dB. As I mentioned in my earlier post, volume properties set in the FMOD Engine function as multipliers to the signal’s amplitude. A volume property of 1 multiplies the amplitude by 1, resulting in no change. Similarly, a volume property of 0 causes the amplitude of the signal to be multiplied by 0, resulting it dead silence.
What do you mean by your “user input volume slider?” It sounds like a feature of a GUI or hardware device, but I’m not aware of any feature by that name in FMOD Studio or FMOD for Unreal, and you haven’t mentioned that you’re using a hardware control surface.
Without knowing more about this “user input volume slider,” I cannot tell you why it behaves the way it does.
Ok, sorry - by user input I simply mean a slider style widget in UE that outputs a value that I send to the VCA.
I’m unsure why I had issues before, but volume is now reconciling with 1=0db. But I’m still confused by this being a multiplier control. My setup is this:
10 UI buttons the user navigates between linearly (l > r or r < l). When navigated to, each button sends a value to the VCA, from 0 to 1. (0, 0.1, 0.2, 0.3, etc).
The volume starts at 1, so the furthest right button is highlighted. Moving to the left sends 0.9, reducing the volume. Navigating all the way to the furthest left button results in silence.
But, from silence, navigating all the way back to the right results in 0db. I can’t reconcile this with a multiplier control as I never multiply by more than 1, yet the volume goes up? I feel like I’m missing something here?
You are missing something. You are assuming that the multiplier is added iteratively, which is to say, that every time the player changes the volume, all previously-applied multipliers remain in place, and the new multiplier is applied to their result. This is not the case (and would result in the CPU consumption of your game’s audio increasing every time you changed the volume).
Instead, whenever you change the multiplier, that replaces the multiplier that was previously in place. So, if you change the volume from 0 to 0.1, the signal’s amplitude stops being multiplied by 0 and begins being multiplied by 0.1 instead. Since it’s not being multiplied by 0 any more, this results in it no longer being silent. Similarly, if you change the volume from 0.8 to 0.9, the volume will increase, because the signal is no longer being multiplied by 0.8, but is being multiplied by 0.9, and 0.9 is a bigger number than 0.8.
To put it another way, changing the volume from 0 to 0.5 to 0.9 does not mean that the volume calculation has gone from
final volume = base volume * 0
to final volume = base volume * 0 * 0.5 * 0.9
;
it means that the volume calculation has gone from
final volume = base volume * 0
to final volume = base volume * 0.9
.
Ok thanks, makes sense to me now. So the method I outlined would be the correct way to set the volume from silence to 0db at 10 increments, right?
If you mean having a set of ten buttons that each set the volume of a VCA to a specific level, then yes, that should allow you to set the volume to ten different values.
Perfect, thanks!