how to choose the appropriate volume (gain) for sounds ?

Started by RemiD, April 23, 2021, 20:44:40

Previous topic - Next topic

RemiD

hi ! :)

how to choose the appropriate volume (gain) for sounds ?

what i did for my last game (VShooter) :
-record the sounds with my smartphone microphone
-extract the parts of the sounds that i need with Wavepad
-set the Windows volume at 50% on my computer
-listen to each sound (with earphones) and amplify the "volume" until it becomes too loud to listen to
-export the tweaked sound


however, i have checked on 3 computers, and depending on the sound card and on the speakers / earphones, even if the Windows volume is set at 50%, on 2 computers i can hear well enough, but on 1 computer i can barely hear anything...  strange ???


so my idea was to amplify the volume x2, and to set the default Volume value to 0.5 in my code, and allow the player to increase / decrease the Volume value in game (using PAGEUP PAGEDOWN keys)


How do you manage that on your side ?

GW

Normalize all of your audio to -3dB.  Have a default volume level of 50%. Allow the user to adjust the volume in settings.

RemiD


RemiD

i have done some experiments, and -3db seems too high imo...

if i set the Windows volume to 50%

and if i set the volume to 50% in my game.

i think that -9db is enough for sounds emitted from player

and maybe have a higher volume (gain in db) for sounds emitted from another source (from a bot, from a bullet, from an explosion, from a particles emitter, ...)

(of course it also depends on the speakers / earphones, hence the necessity to be able to set the volume in-game)

anyway thanks !

Derron

https://www.gamedev.net/forums/topic/701848-volume-and-normalization-for-sfx

-> normalize to 0dB so you avoid clipping and keep "maximum possible depth"
-> adjust volume _ingame_


https://www.homebrewaudio.com/audio-normalization-care/

-> dB is not linear


So normally you design your sound effects "ingame" so they fit together.
The normalization you do helps to avoid clipping issues.

But ... think of what happens if you decide for eg -3dB - and are normalizing two monologue audio files with -3dB. One file contained a shouted word next to some normal spoken words.
What happens now? the "non shout"-version is normalized to -3dB. All the words are peaking at -3dB. The "shout"-version is normalized to -3dB too, the "shouted word" is peaking at -3dB but the normal spoken ones maybe at -6dB.
Now you let both audio files play each after another ... you will hear the _voice_ suddenly becoming more silent until the "shout" is played back with the same volume than the first audio.

This is why you could and should only normalize "all the sounds together" (this is also why there exists a "album gain" in mp3gain ... so it takes all songs into consideration - else a soothing track would play as loud as a heavy party pop thing).



I also normalize my audio files - but inside of my game (or the config files) you can adjust the (base) volume of each played audio - so the "audio designer" (nobody assigned to that "job" for now :D) decides on how "loud" an audio is to play in the overall "audio mix" of the game. Next to this basic volume value there are others to decide for panning (left right - stereo) and one which acts as further volumeModifier for this sound - depending on how "far away" an object is from the player figure ("can hear it"). This is done with "game logic". So each floor in the building cuts the modifier by a huge amount while the distance on the same floor only has a minor effect.
This way the "elevator" in my building gets more and more silent the further away it goes - or the further away my player figure moves from the elevator doors.



bye
Ron


RemiD

sometimes it is better to set the Windows volume to 50% and to use your own ears to adjust the volume of each sound (how loud each sound should be depending on the source from which it is emitted)

that's what i did in my game (for the competition), and i like the result, the only mistake i made was to set the game volume to 1.0, and the Player can't increase / decrease the sounds volume in-game...

but easy to improve for the next release. (set the master volume to 0.5, and amplify each sound volume by 200% or more, and allow the Player to set the sounds volume in-game)

Derron

dunno what "amplify by 200%" means - in the sense of clipping etc.

Volume changes should only happen in the "mixer". And if you give each sound objects a custom "volumeMod:Float" ... you can fine tune each sound in the game as you desire.

The master volume can be 50% or 100% ... I would say 100% - as there is no reason to go "beyond". 100% of master volume, 100% of OS master volume and 100% max volume of your speakers (hardware) should be 100% of possible "output" (if the sound used 0db levels the whole time).

BUT ... what must be adjustable is:
- music
- sfx
- voice
... and maybe even finer graded: environment sfx (birds, wind, thunder...), active spells (attack sounds, magic explosions...)

So people can decide if stuff they hear "often/regularly" should be less loud while an "PVP enemy approaching"-warn sound should stay loud.


So technically this means (all "in your game", not "mixer in operating system"):
- master volume
- sound type volume ("sfx", "voice over", "music", "ambient sounds")
- sound tag volume ("spells", "notifications")
- sound volume (for each individual sound. so "explosion.wav" but also "artificially created SFX for a flipped coin")

Then for each "to mix in" audio you do
effectiveVolume = masterVolume * soundTypeVolume * soundTagVolume * soundVolume

This way you can define as user, you prefer loud SFX but spells should be more silent than notifications.

Of course there are other "math formulas" than just multiplying. You could have relative dependencies (so the SFX volume defines how strong your "notification sfx" is affected) or similar stuff. Eg each sound effect could have an "ignoreSoundTypeVolume" flag, or an "ignoreSoundTagVolume". This way you could even allow individual volumes for very specific sounds (eg the arousing attack scream of the succubus could play at "100% of master volume")


bye
Ron

RemiD

in wavepad, 'amplify' 200% means the volume that you hear is 2 times higher (related to the db value), but it is different than 'normalize' in the sense that it does not take into account a peak max value.
i don't think it is a good idea to have all sounds use the same max db value, since in a 3d game, depending on the source from which each sound is emitted, the nearer the source, the less volume is necessary, and the farer the source, the more volume may be necessary.

so i am going to rely on my hears to adjust the volume of each sound (with Windows volume at 50% and game volume at 50%), and then test with different computers / speakers / earphones.

Derron

Quote from: RemiD on May 04, 2021, 08:53:44
so i am going to rely on my hears to adjust the volume of each sound (with Windows volume at 50% and game volume at 50%), and then test with different computers / speakers / earphones.


Read my post again and answer me what you gain from "windows volume at 50% and game volume at 50%" ... then attach a different set of speakers, or an actively powered earphone set or ...

Only thing you could gain benefits of is your "rely on my ears". So that the played sounds "fit" together (loudness wise).

The other stuff you mentioned: 3d sound -> people do expect a maximum loudness of your game. You cannot simply do a "make sound loud enough for when 5 m away and 3 times louder when near". People would adjust their speakers to be as loud as wanted for "default situations" and they wont be happy if somehow the speakers play a 3 times as loud sound just because a ingame explosion took place in front of the "camera".
You will recognize the same in movies - an explosion is not 150 dB compared to 30dB of "whispering/normal talk". So do as you wrote : rely on your ears, define a "max volume" for a sound, a "min volume" (and also a max-distance to still be heard - for a nice falloff).


bye
Ron