WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   PlaySoundFile issue (https://www.wowinterface.com/forums/showthread.php?t=57367)

Brellison94 08-18-19 08:58 AM

PlaySoundFile issue
 
Did they change the strings of the PlaySoundFile recently? Sound files are muted when I been working on Bosstalk recently, and just haven't had the time to look into it.

myrroddin 08-18-19 05:20 PM

Yes. You need to use the numeric value for sound kits, not the strings.

https://www.townlong-yak.com/framexm...tConstants.lua
Code:

PlaySoundFile(120) -- new
PlaySoundFile(LOOT_WINDOW_COIN_SOUND) -- old


Kanegasi 08-18-19 07:46 PM

Yes, PlaySound no longer takes sound names, only sound IDs, but that's not the issue here.

OP is using PlaySoundFile, which is affected by another issue. A recent change to further obfuscate the WoW install has broken sound files. PlaySoundFile cannot be used to play any WoW sound paths, only addon sound paths. Sounds can no longer be "replaced" either, such as a Hunter silencing/changing gun sounds.

If PlaySoundFile takes IDs, they will be file IDs, not sound IDs. Using the loot coin sound mentioned above, these two function calls should theoretically produce the same sound:

PlaySound(120)
PlaySoundFile(567428)

Based on the file searches, there are two loot coin sounds. I believe sound ID 120 plays both, but I only found that one file ID. wow.tools is frustrating to navigate on a phone.

Brellison94 08-20-19 04:22 PM

Quote:

Originally Posted by myrroddin (Post 333273)
Yes. You need to use the numeric value for sound kits, not the strings.

https://www.townlong-yak.com/framexm...tConstants.lua
Code:

PlaySoundFile(120) -- new
PlaySoundFile(LOOT_WINDOW_COIN_SOUND) -- old


Current Code:
Code:

if button == "LeftButton" then
                        PlaySoundFile("Sound\\Creature\\"..BossTalk.data[tonumber(strsub(link, 5))].sound..".ogg")
                        UIErrorsFrame:AddMessage(BossTalk.data[tonumber(strsub(link, 5))].text, 1.0, 0.2, 0.2, 1, 5);
                        BossTalk:SendMessage(BossTalk.data[tonumber(strsub(link, 5))].boss,BossTalk.data[tonumber(strsub(link, 5))].sound,"normal")
                        return;
                else
                        BossTalk.searchcmd = { type='group', args = { welcha = {        type = 'header', name = "|cff00ff00#"..strsub(link, 5)..":|r |cffffff00"..strsub(BossTalk.data[tonumber(strsub(link, 5))].text,1,20).."...\n|r", order = 3, },
                        playsound = { type = 'execute', name =        L["Play sound"], desc = " ", func = function() PlaySoundFile("Sound\\Creature\\"..BossTalk.data[tonumber(strsub(link, 5))].sound..".ogg"); UIErrorsFrame:AddMessage(BossTalk.data[tonumber(strsub(link, 5))].text, 1.0, 0.2, 0.2, 1, 5); BossTalk:SendMessage(BossTalk.data[tonumber(strsub(link, 5))].boss,BossTalk.data[tonumber(strsub(link, 5))].sound,"normal"); end, order = 5,},
                        addfav = { type = 'execute', name =        L["Add to favorites"], desc = " ", func = function() local old = BossTalk:tcount(dbd.favoriten)+1; for z=1,BossTalk:tcount(dbd.favoriten) do if dbd.favoriten[z].text == BossTalk.data[tonumber(strsub(link, 5))].text then BossTalk:Print(L["Yell is already in list!"]); return; end end dbd.favoriten[old]=BossTalk.data[tonumber(strsub(link, 5))]; BossTalk:MakeFunk(); BossTalk:Print(L["Yell added"]); end, order = 6,},
                        addign = {type = 'execute', name =        L["Add to ignore list"], desc = " ", func = function() for z=1,BossTalk:tcount(dbd.ignoyell) do if dbd.ignoyell[z].id == tonumber(strsub(link, 5)) then BossTalk:Print(L["Yell is already in list!"]); return; end end dbd.ignoyell[#dbd.ignoyell+1] = { ["id"] = tonumber(strsub(link, 5)), ["yell"]=BossTalk.data[tonumber(strsub(link, 5))].text, ["sound"]=BossTalk.data[tonumber(strsub(link, 5))].sound } BossTalk:MakeIgno() BossTalk:Print(L["Yell added"]) end, order = 7,},},}
                        BTchat:Register("BossTalkChatFrame", 'children', function()
                        BTchat:FeedAceOptionsTable(BossTalk.searchcmd) end )
                        BTchat:Open("BossTalkChatFrame", 'cursorX', true, 'cursorY', true)
                        BTchat:Unregister("BossTalkChatFrame")
                        return;
                end (Lines 636 - 651)

PlaySoundFile("Sound\\Creature\\"..arg2..".ogg") (Line 1146)

PlaySoundFile("Sound\\Creature\\"..M.sound.."") (Line 1200)

New Code: ?


All times are GMT -6. The time now is 04:54 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI