WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   AddOn Help/Support (https://www.wowinterface.com/forums/forumdisplay.php?f=3)
-   -   How to identify which sound is being played? (https://www.wowinterface.com/forums/showthread.php?t=59792)

sp00n 02-14-24 07:34 AM

How to identify which sound is being played?
 
Is there an easier way to determine which sound was being played by the game than noting down when/where it occurred and then searching through Wowhead what could've caused the issue?

Before I stopped playing over a decade ago it was still possible to create a \Sound directory and place all the extracted sound files there, which allowed me to use Process Monitor to check which sound files were being accessed by WoW (and then subsequently mute them by replacing them with a silent .ogg/.wav), however this is not the case anymore, since WoW only seems to read the files directly from its packed \Data files nowadays.

So now we're left with the MuteSound API, which requires the IDs of the sound files. But how can we get these, without wading through Wowhead as previously mentioned?

I tried to hook the PlaySound and PlaySoundFile calls like this:
Lua Code:
  1. hooksecurefunc("PlaySound", print)
  2. hooksecurefunc("PlaySoundFile", print)
However this only seems to fire for a few actions, like opening your character sheet. It does not seem to fire for spells or mounts.

So is there any way to get these sound file IDS programmatically, or at least somewhat automatically?

Fizzlemizz 02-14-24 07:42 AM

In-game you could try Leatrix Sounds otherwise Wago.Tools

sp00n 02-14-24 07:51 AM

But as far as I'm aware these would just be alternatives to looking through Wowhead, it would still need to be a fully manual process (noting down, search what could've caused it).

Fizzlemizz 02-14-24 09:10 AM

The PlaySound API functions are for the UI (addons) section of the game to play sounds. The rest of the game sounds will be played by "internal" game engine functions not accessible by the UI API so for those, it requires a manual process.

sp00n 02-14-24 09:50 AM

That is unfortunate.


However I noticed that Process Monitor does capture the offset at which a compressed data file is being read, so maybe that could somehow be used with the existing CASC explorer / export tools.

Theoretically one would need to translate that offset into a file id / file name. I assume the files are stored with some sort of index, which does eventually translate into an offset, so that they can be exported by these tools. 🤔

Of course this wouldn't be an instant solution, but at least you could record some gameplay with ProcMon running and then afterwards run a compare script that matches the offsets to the packed files.

At least that's an idea in my head right now, I'm not sure if it's even possible (or if I want to dive into that, that CASC format seems pretty complex).


Code:

Time of Day  Process Name  PID    Operation  Path                                            Result    Detail
14:12:59,04  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.098  SUCCESS  Offset: 496.959.488, Length: 5.308.416
14:12:59,04  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.098  SUCCESS  Offset: 502.267.904, Length: 65.536
14:12:59,07  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.098  SUCCESS  Offset: 309.133.312, Length: 65.536
14:12:59,07  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.098  SUCCESS  Offset: 309.198.848, Length: 5.242.880
14:12:59,07  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.098  SUCCESS  Offset: 314.441.728, Length: 65.536
14:12:59,10  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.096  SUCCESS  Offset: 997.064.704, Length: 65.536
14:12:59,10  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.096  SUCCESS  Offset: 997.130.240, Length: 3.932.160
14:12:59,10  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.096  SUCCESS  Offset: 1.001.062.400, Length: 65.536
14:12:59,13  Wow.exe        24968  ReadFile    E:\Games\World of Warcraft\Data\data\data.096  SUCCESS  Offset: 562.036.736, Length: 65.536


sp00n 02-15-24 07:28 PM

So I was able to modify the source code of wow.export so that it would show me the used offset to export/play a sound file.

The offset being displayed there doesn't match exactly the offset recorded from Process Monitor, but it's pretty close.

For example:
Code:

WoW command
-----------------
/run PlaySoundFile(1984506)


Process Monitor
------------------
E:\Games\World of Warcraft\Data\data\data.056
Offset: 238.026.752
Length: 65.536


wow.export
-------------
Previewing sound file sound/creature/shadeweaver_zarra/vo_801_shadeweaver_zarra_04_f.ogg
fileDataID: 1984506
offset: 238047012
size: 18900


Difference
-----------
238047012-238026752= 20260 byte


Code:

WoW command
-----------------
/run PlaySoundFile(1984510)


Process Monitor
------------------
E:\Games\World of Warcraft\Data\data\data.080
Offset: 743.309.312
Length: 65.536


E:\Games\World of Warcraft\Data\data\data.080
Offset: 743.374.848
Length: 65.536


wow.export
-------------
Previewing sound file sound/creature/gunnolf_the_ferocious/vo_801_gunnolf_the_ferocious_01_m.ogg
fileDataID: 1984510
offset: 743359844
size: 32062


Difference
-----------
743359844-743309312= 50532 byte
743359844-743374848= -15004 byte


So the latter one is interesting, it recorded two entries, which are very close to each other, but none of them match the wow.export value, or the difference from the first entry.
So not sure what's going on there exactly.


All times are GMT -6. The time now is 07:29 AM.

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