Chatter

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

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

User When Change
jeffguy May 25, 2015 at 16:37 UTC Create

You must login to post a comment. Don't have an account? Register to get one!

Facts

Reported
May 25, 2015
Status
New - Issue has not had initial review yet.
Type
Defect - A shortcoming, fault, or imperfection
Priority
Medium - Normal priority.
Votes
0

Reported by

Possible assignees