Raised This Month: $32 Target: $400
 8% 

Making sound louder


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Little Endian
Junior Member
Join Date: Jan 2018
Old 01-14-2018 , 09:47   Making sound louder
Reply With Quote #1

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.

Last edited by Little Endian; 01-14-2018 at 09:49.
Little Endian is offline
Ryan.
Member
Join Date: Jan 2018
Old 01-27-2018 , 18:43   Re: Making sound louder
Reply With Quote #2

Sound level represents the attenuation. That is, how far the sound carries before it fades to silence.
Sound volume is limited between 0-1 with 1 being full volume.

You can boost a sound's volume more by playing it multiple times in different channels.
Ryan. is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode