Feature request: Play sound when receiving whispers (code included) #305


  • New
  • Defect
Open
Assigned to ardentvark
  • _ForgeUser1832250 created this issue May 25, 2015

    Could you add the option to play sounds on certain types of incoming messages? This would be SUPER useful as I wind up missing some.

    Here is basic code that does this:

    function ChatSounds_OnLoad(self)
      self:RegisterEvent("CHAT_MSG_WHISPER");
      self:RegisterEvent("CHAT_MSG_BN_WHISPER")
      self:RegisterEvent("CHAT_MSG_GUILD");
      self:RegisterEvent("CHAT_MSG_PARTY");
      self:RegisterEvent("CHAT_MSG_PARTY_LEADER");
      self:RegisterEvent("CHAT_MSG_RAID");
      self:RegisterEvent("CHAT_MSG_RAID_LEADER");
      LoggingChat(1);
    end

    function ChatSounds_OnEvent(self, event, ...)
      if (event=="CHAT_MSG_WHISPER") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\whisper.mp3");
      end
      if (event=="CHAT_MSG_BN_WHISPER") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\whisper.mp3");
      end
      if (event=="CHAT_MSG_GUILD") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\guild.mp3");
      end
      if (event=="CHAT_MSG_PARTY") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\party.mp3");
      end
      if (event=="CHAT_MSG_PARTY_LEADER") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\party.mp3");
      end
      if (event=="CHAT_MSG_RAID") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\raid.mp3");
      end
      if (event=="CHAT_MSG_RAID_LEADER") then
        PlaySoundFile("Interface\\AddOns\\ChatSounds\\raidleader.mp3");
      end
    end

  • _ForgeUser1832250 added the tags New Defect May 25, 2015

To post a comment, please login or register a new account.