Weapon Sounds Cutting Out

When a weapon with a high rate of fire uses a sound with a lot of echo that goes on for a while, the sound seems to cut out for several rounds before starting for a couple, then cutting out again. Is there a workaround for this phenomenon?

If you use self.Weapon:EmitSound(), try self.Owner:EmitSound()

Zephyr the best way to fix this (If what I’m assuming is correct) Is to run sound scripts instead of directly calling the sound’s filepath. It fixes the sound from not always playing and gets rid of sounds overlapping.

Here’s the wiki page on how to make lua-based sound-scripts: http://wiki.garrysmod.com/page/sound/Add

So instead of calling weapon/m4a1/m4a1-1.wav you would be calling M4A1.SingleFire for example.

local st = {}
	st["channel"]	=	"CHAN_ITEM"
	st["volume"]	=	"1.0"
	st["pitch"]		=	"PITCH_NORM"
	st["sound"]		=	"version_a1/weapons/xyz/shooty.wav" 
		st["name"]	=	"Weapon_XYZ.Single"

This is the code I was using, does this no longer work?

Assuming it is, would this work? Or is this one of the functions that doesn’t cooperate with loops?

soundsToAdd = {
{"name1", "path1"}
{"name2", "path2"}
{"name3", "path3"}

for _, sound in Pairs(soundsToAdd) do
	sound.Add( {
		name = sound[1],
		channel = CHAN_STATIC,
		volume = 1.0,
		soundlevel = 80,
		pitchstart = 95,
		pitchend = 110,
		sound = sound[2]
	} )

Also, what’s the correct channel for weapons?


Shared function, so /autorun/, not /autorun/server/, correct? And will the for loop work, if anyone knows?

Well, I worked around it by going into Audacity and just cutting em short. There’s no difference when firing, just not as much echo.

That’s what I had been doing. It makes them sound like garbage sometimes. Especially when bursting with high RPM weapons with short sounds.

I mean try not to make them too short that it cuts out the initial firing.