Stop sounds

How do I make my weapon stop the firing loop sound when I relese primary? ( left click )
Also how would I make it play a sound when I relesed the Primary?

C’mon, Someone?

function SWEP:PrimaryAttack()
–Your code, bla bla bla
self.Weapon:EmitSound( “Path/to/the/sound.wav” )

The sound will be played every time your gun shoots a shot.