Are the distant and echoed gunshot sounds all done in-engine?

When NPCs are far from you and fire, their gunshot sounds are muffled/echoed. I’m trying to create this functionality on my own swep. I assumed the engine handled it and pitched down a sound at a certain distance but that isn’t the case. My swep’s firing sound just diminishes the further away. (I’m using smg_fire1). I tried lowering the pitch on emitsound but that didn’t sound right at all. Are these distant gunshot sounds a separate sound file? Or is the engine doing some filter overlay magic on the sound file that we can’t do in lua?

Afaik this is done via soundscripts.

Damn, then I’m out of luck then? I’ve discovered using “Weapon_SMG1.NPC_Single” instead of “weapons/smg1/npc_smg1_fire1.wav” will correctly do the whole echo distance thing but since its not a wav file you can use emitsound to change its pitch/volume.