Hi everyone,
I am trying to make a sound louder using SoundEmitToAll() from a player entity:
Code:
EmitSoundToAll("pathToMySound", client);
sdktools_sound.inc lists the parameters of level and volume as follows:
Code:
enum
{
SNDLEVEL_NONE = 0, /**< None */
SNDLEVEL_RUSTLE = 20, /**< Rustling leaves */
SNDLEVEL_WHISPER = 25, /**< Whispering */
SNDLEVEL_LIBRARY = 30, /**< In a library */
SNDLEVEL_FRIDGE = 45, /**< Refrigerator */
SNDLEVEL_HOME = 50, /**< Average home (3.9 attn) */
SNDLEVEL_CONVO = 60, /**< Normal conversation (2.0 attn) */
SNDLEVEL_DRYER = 60, /**< Clothes dryer */
SNDLEVEL_DISHWASHER = 65, /**< Dishwasher/washing machine (1.5 attn) */
SNDLEVEL_CAR = 70, /**< Car or vacuum cleaner (1.0 attn) */
SNDLEVEL_NORMAL = 75, /**< Normal sound level */
SNDLEVEL_TRAFFIC = 75, /**< Busy traffic (0.8 attn) */
SNDLEVEL_MINIBIKE = 80, /**< Mini-bike, alarm clock (0.7 attn) */
SNDLEVEL_SCREAMING = 90, /**< Screaming child (0.5 attn) */
SNDLEVEL_TRAIN = 100, /**< Subway train, pneumatic drill (0.4 attn) */
SNDLEVEL_HELICOPTER = 105, /**< Helicopter */
SNDLEVEL_SNOWMOBILE = 110, /**< Snow mobile */
SNDLEVEL_AIRCRAFT = 120, /**< Auto horn, aircraft */
SNDLEVEL_RAIDSIREN = 130, /**< Air raid siren */
SNDLEVEL_GUNFIRE = 140, /**< Gunshot, jet engine (0.27 attn) */
SNDLEVEL_ROCKET = 180, /**< Rocket launching (0.2 attn) */
};
#define SNDVOL_NORMAL 1.0 /**< Normal volume */
stock void EmitSoundToAll(const char[] sample,
int entity = SOUND_FROM_PLAYER,
int channel = SNDCHAN_AUTO,
int level = SNDLEVEL_NORMAL,
int flags = SND_NOFLAGS,
float volume = SNDVOL_NORMAL,
int pitch = SNDPITCH_NORMAL,
int speakerentity = -1,
const float origin[3] = NULL_VECTOR,
const float dir[3] = NULL_VECTOR,
bool updatePos = true,
float soundtime = 0.0)
My guess is that the volume should be set as a factor of SNDVOL_NORMAL (e.g. 2 making the sound twice louder).
I tried playing with different values but setting a volume other than 1.0 mutes the sound completely and setting the level to a higher value doesn't seem to affect the sound.
Can someone please explain the relations between those two clearly? Documentation seems to be lacking on this subject.