Drowning out other sounds (I.E. Explosion deaf effect)?

Hello FP,
Is there any lua function that I can use to simulate that ear ringing sound in Garrysmod similar to the one heard near an explosion? To state what I’m using it for, for further detail, I want all sounds other then a heartbeat sound to be ‘drowned out’. I got that part down but am unsure if theres such a function in Garrysmod or how I would simulate it.

Bastinka

[editline]08:35AM[/editline]

Found it, but is there a way I can keep one sound playing?

Well, as you would want the sound muffled it would be something like


ply:SetDSP(31,false)


or even



ply:SetDSP(34,false)


if you wanted the ear ringing effect as well.

Do you mean the DSP effect or do you mean getting your heartbeat sound to loop?
If you mean getting it to loop, you can easily start it with timer.Create, and end it with timer.Stop



local function MyFunc()
 //Do your heartbeat sound
end
timer.Create("MyHeartbeatTimer",0.7,0,MyFunc)

//To stop it

timer.Stop("MyHeartbeatTimer")

//You could also stop it automatically by changing the 0 to how many times you want the timer to be run.
//http://wiki.garrysmod.com/?title=Timer.Create


Yeah, is there any way to create my own DSP effect where everything else but the heartbeat looping is drowned out. I already got it to loop, don’t need Lua for that :stuck_out_tongue:

I don’t think you can create your own, although that might be possible.
DSP 31 is the best you can do for that I think.
There are probably more knowledgeable people than me on this