Quantcast PlaySoundFile issue - WoWInterface
Thread Tools Display Modes
08-18-19, 08:58 AM   #1
Brellison94
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 36
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.

Last edited by Brellison94 : 08-18-19 at 09:17 AM.
  Reply With Quote
08-18-19, 05:20 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,059
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

Last edited by myrroddin : 08-18-19 at 05:23 PM. Reason: Example added
  Reply With Quote
08-18-19, 07:46 PM   #3
Kanegasi
A Scalebane Royal Guard
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 411
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.
  Reply With Quote
08-20-19, 04:22 PM   #4
Brellison94
An Aku'mai Servant
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 36
Originally Posted by myrroddin View Post
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: ?
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » PlaySoundFile issue

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off