First, you need to go into data.pak, find the folder \Sounds\_(Sound)\Creatures - then there are folders with faction names, and inside them folders with unit sounds
The files in xdb format contain sound settings and THE NAMES OF THE SOUND FILES YOU NEED
For example, in the folder \Sounds\_(Sound)\Creatures\Haven\Peasant there is a file happy.xdb, and it says
<uid>8E412366-DB9F-4586-8635-32B090865984</uid>
which means the sound file in sound.pak is called 8E412366-DB9F-4586-8635-32B090865984. If you add .wav at the end of its name, it becomes a regular sound file
Thank you. I also searched around the internet a bit more thoroughly and found a guide on this same site. Here are the lines from that guide:
////
A mod that changes sounds
Example:
1. Go into data.pak/Sounds/_(Sound)/Creatures/Sylvan/Druid/happy.xdb
2. There we learn that the needed file has the name "2A847EF6-49B8-402E-9728-1C97645F5C3B"
3. Go into soundsfx.pak/bin /Sounds/ and find the needed file and extract it.
4. Take your wav-file, for example, «I'll be back» performed by Arnie, give it the name "2A847EF6-49B8-402E-9728-1C97645F5C3B", pack it, preserving the folder structure.
In this case, when rejoicing in battle, Druids will speak in Terminator's voice saying «I'll be back»!!!
////
I have a question. Do I understand correctly that if I want to change a line, I create a separate folder, recreate the full folder structure as in the original. At the end of all this structure, I add the file responsible for the sound I need, and name it the same as stated in the xdb file in the data.pak folder?
Two questions arise here. Do I load the sound there in wav format, and then simply erase the .wav characters from the file name so it remains without an extension like the original?
And the second question. When I archive my work back into pak, can I name that archive whatever I want, as long as the structure inside the archive is preserved properly?