View Single Post
04-20-17, 08:16 AM   #4
Ketho
A Pyroguard Emberseer
 
Ketho's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,026
You could maybe temporarily enable all sounds when an addon's sound file is playing as a workaround
Lua Code:
  1. local function DisableSound()
  2.     SetCVar("Sound_EnableAllSound", 0)
  3. end
  4.  
  5. --[[ posthook does not seem to work
  6. hooksecurefunc("PlaySoundFile", function()
  7.     SetCVar("Sound_EnableAllSound", 1)
  8.     C_Timer.After(3, DisableSound)
  9. end)
  10. ]]
  11.  
  12. local oldPlaySoundFile = PlaySoundFile
  13.  
  14. function PlaySoundFile(...)
  15.     SetCVar("Sound_EnableAllSound", 1)
  16.     C_Timer.After(3, DisableSound)
  17.     oldPlaySoundFile(...)
  18. end
  19.  
  20. DisableSound()
  Reply With Quote