Type Sets1
SymbolDescription
NormalSHook
Type Definitions1
SymbolDescription
AmbientSHookCalled when an ambient sound is about to be emitted to one or more clients. NOTICE: all parameters can be overwritten to modify the default behavior.
Constants43
SymbolDescription
SND_CHANGEPITCHChange sound pitch
SND_CHANGEVOLChange sound volume
SND_DELAYSound has an initial delay
SND_DO_NOT_OVERWRITE_EXISTING_ON_CHANNELIf an existing sound is found on the channel, the sound will not play instead of overwriting it
SND_IGNORE_NAMEChanges all sounds emitted on the entity, regardless of actual name
SND_IGNORE_PHONEMESPrevents flex animation from being driven by this sound
SND_NOFLAGSNothing
SND_SHOULDPAUSEPause if game is paused
SND_SPAWNINGUsed in some cases for ambients
SND_SPEAKERBeing played by a mic through a speaker
SND_STOPStop the sound
SND_STOPLOOPINGStop looping all sounds on the entity
SNDCHAN_AUTOAuto
SNDCHAN_BODYPlayer?
SNDCHAN_ITEMItems
SNDCHAN_REPLACEUnknown
SNDCHAN_STATIC"Stream channel from the static area"
SNDCHAN_STREAM"Stream channel from the static or dynamic area"
SNDCHAN_USER_BASEAnything >= this is allocated to game code
SNDCHAN_VOICEVoices
SNDCHAN_VOICE_BASE"Channel for network voice data"
SNDCHAN_WEAPONWeapons
SNDLEVEL_AIRCRAFTAuto horn, aircraft
SNDLEVEL_CARCar or vacuum cleaner (1.0 attn)
SNDLEVEL_CONVONormal conversation (2.0 attn)
SNDLEVEL_DISHWASHERDishwasher/washing machine (1.5 attn)
SNDLEVEL_DRYERClothes dryer
SNDLEVEL_FRIDGERefrigerator
SNDLEVEL_GUNFIREGunshot, jet engine (0.27 attn)
SNDLEVEL_HELICOPTERHelicopter
SNDLEVEL_HOMEAverage home (3.9 attn)
SNDLEVEL_LIBRARYIn a library
SNDLEVEL_MINIBIKEMini-bike, alarm clock (0.7 attn)
SNDLEVEL_NONENone
SNDLEVEL_NORMALNormal sound level
SNDLEVEL_RAIDSIRENAir raid siren
SNDLEVEL_ROCKETRocket launching (0.2 attn)
SNDLEVEL_RUSTLERustling leaves
SNDLEVEL_SCREAMINGScreaming child (0.5 attn)
SNDLEVEL_SNOWMOBILESnow mobile
SNDLEVEL_TRAFFICBusy traffic (0.8 attn)
SNDLEVEL_TRAINSubway train, pneumatic drill (0.4 attn)
SNDLEVEL_WHISPERWhispering
Defines12
SymbolDescription
SNDATTN_IDLEIdle attenuation?
SNDATTN_NONENo attenuation
SNDATTN_NORMALNormal attenuation
SNDATTN_RICOCHETRicochet effect
SNDATTN_STATICStatic attenuation?
SNDPITCH_HIGHA high pitch
SNDPITCH_LOWA low pitch
SNDPITCH_NORMALNormal pitch
SNDVOL_NORMALNormal volume
SOUND_FROM_LOCAL_PLAYER
SOUND_FROM_PLAYER
SOUND_FROM_WORLD
Functions22
SymbolDescription
AddAmbientSoundHookHooks all played ambient sounds.
AddNormalSoundHookHooks all played normal sounds.
ATTN_TO_SNDLEVELConverts an attenuation value to a sound level. This function is from the HL2SDK.
EmitAmbientGameSoundEmits an ambient game sound. Game sounds are found in a game's scripts/game_sound.txt or other files referenced from it Note that if a game sound has a rndwave section, one of them will be returned at random.
EmitAmbientSoundEmits an ambient sound.
EmitGameSoundEmits a game sound to a list of clients. Game sounds are found in a game's scripts/game_sound.txt or other files referenced from it Note that if a game sound has a rndwave section, one of them will be returned at random.
EmitGameSoundToAllWrapper to emit game sound to all clients. Game sounds are found in a game's scripts/game_sound.txt or other files referenced from it Note that if a game sound has a rndwave section, one of them will be returned at random.
EmitGameSoundToClientWrapper to emit a game sound to one client. Game sounds are found in a game's scripts/game_sound.txt or other files referenced from it Note that if a game sound has a rndwave section, one of them will be returned at random.
EmitSentenceEmits a sentence to a list of clients.
EmitSoundEmits a sound to a list of clients.
EmitSoundEntryEmits a sound or game sound to a list of clients using the latest version of the engine sound interface. This native is only available in engines that are greater than or equal to Portal 2.
EmitSoundToAllWrapper to emit sound to all clients.
EmitSoundToClientWrapper to emit sound to one client.
FadeClientVolumeFades a client's volume level toward silence or a given percentage.
GetDistGainFromSoundLevelCalculates gain of sound on given distance with given sound level in decibel
GetGameSoundParamsRetrieves the parameters for a game sound. Game sounds are found in a game's scripts/game_sound.txt or other files referenced from it Note that if a game sound has a rndwave section, one of them will be returned at random.
GetSoundDuration
PrecacheScriptSoundPrecache a game sound. Most games will precache all game sounds on map start, but this is not guaranteed... Team Fortress 2 is known to not pre-cache MvM game mode sounds on non-MvM maps. Due to the above, this native should be called before any calls to GetGameSoundParams, EmitGameSound*, or EmitAmbientGameSound. It should be safe to pass already precached game sounds to this function. Note: It precaches all files for a game sound.
PrefetchSoundPrefetches a sound.
RemoveAmbientSoundHookUnhooks all played ambient sounds.
RemoveNormalSoundHookUnhooks all played normal sounds.
StopSoundStops a sound.