View Single Post
08-31-17, 01:26 AM   #6
BujuArena
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 13
I made a handy little tool called PlaySoundFixer to fix PlaySound breakage.

https://wow.curseforge.com/projects/playsoundfixer

This tiny addon hooks PlaySound, running any working PlaySound call and preventing any broken PlaySound call from breaking the game and telling you the line of code in your broken addon so you can go comment it out (with "--" at the beginning of the line) or fix it (with "SOUNDKIT.THE_CORRECT_SOUND").

Here's the code:

Code:
local oldPlaySound = PlaySound
PlaySound = function(sound, ...)
    if type(sound)=="number" then
        return oldPlaySound(sound, ...)
    else
        local soundstring = tostring(sound)
        local source = gsub(strtrim(debugstack(2,1,0),".\n"),"Interface\\AddOns\\","")
        print("PSF: broken PlaySound(\""..soundstring.."\") called from "..source)
    end
end
  Reply With Quote