Player.SetDSP
From GMod Wiki
Function | |
Syntax | Player:SetDSP( Integer effect_id, Boolean quickreset ) |
Description: | |
Adds an effect to the specified player's sound that modifies their sound according to the effect id given. | |
Returns: | nil |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.SetDSP]Player.SetDSP [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Modify the local player's sound to muffle all sounds and play a screech sound as if an explosion had just occoured. |
---|---|
Used on | |
Code | LocalPlayer():SetDSP(34, false ) |
Output | Modified sound |
Description | Modify the all players' sound to sound as if it is been synthesized |
---|---|
Used on | |
Code | for _,ply in pairs(player.GetAll()) do ply:SetDSP( 23, false ) end |
Output | Modified sound for all players |
Additional Notes
- Abbreviated list of the IDs:
- 0 and 1 = The default DSP.
- 2-29 = Various forms of indoors echo DSPs (23 is a cool phaser echo DSP).
- 30 and 31 = Muffled DSPs.
- 32-37 = Tinnitus DSPs (explosion effects).
- 38 = "Fuzzy speaker" DSP.
- 39 = Strider pre-laser attack DSP.
- 40-43 = Spatial delay DSPs.
- 44 and 45 = High pitch DSPs.
- 46 = Fade-in/fade-out DSP.
- 47 = Quick echo DSP.
- 48 = Sound test DSP (sounds terrible, don't bother with it).
- 49 = Fading echo DSP.
- 50-59 = DSP Speaker presets (more echo DSPs).
- 60-99 = Slots reserved for automatic DSP creation (don't use these slots).
- 100-133 = Various echo/muffled DSP templates for automatic DSP creation.
- For a full list of ID's to use, see DSP list
- dsp_automatic will allow source to attempt to change the sound effects based on your environment, however, this doesn't always work. A very good way of testing the different effects is to use the command dsp_player <number> in the console. The number you use will set the effect.
- dsp_slow_cpu 1 effectively turns dsp off, dsp_off is a cheat apparently.
- When quickreset is true, the effect will wear off earlier. This is only available on the client, on the server you will get this error:
SetPlayerDSP: fastReset only valid from client
!