Originally Posted by MunkDev
If you want to mute all sounds, use this:
Lua Code:
local dummy = false hooksecurefunc('PlaySound', function(id) if dummy then return end dummy = true local played, handle = PlaySound(id+1) if played then StopSound(handle-1) StopSound(handle) end dummy = false end)
If you want to allow unique sounds, like the talking head monologues or any other uncommon sound, but not UI sounds, use this:
Lua Code:
local dummy, kit = false, {} for _, v in pairs(SOUNDKIT) do kit[v] = true end hooksecurefunc('PlaySound', function(id) if dummy or (not kit[id]) then return end dummy = true local played, handle = PlaySound(id+1) if played then StopSound(handle-1) StopSound(handle) end dummy = false end)
If you want to mute specific sounds use Kanegasi's solution. They all work the same way.
|
The SOUNDKIT table is not nearly as complete as you would like it, mostly they just throw stuff into it that's used by the default UI.
Here is a complete table with old names and IDs that you can play with PlaySound:
https://github.com/Resike/BlizzardIn...ndKitNames.lua