Apex Legends .MSTR

Codecs, formats, encoding/decoding of game audio, video and music
zuronaught
Posts: 12
Joined: Sun Mar 03, 2019 4:17 am

Re: Apex Legends .MSTR

Post by zuronaught »

Lyxi wrote:
xyx0826 wrote:
Lyxi wrote:soon

This looks awesome. Seems like you figured out how the APIs work? Hoping to see more details/progress on it!!

yes sir! been spending about a month on it, got a lot of internal structures documented at this point and i found a path last night that leads to a directsoundbuffer->lock()


When you do release this, can you please explain how you went about it so the rest of us noobs can learn? :D
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

zuronaught wrote:
Lyxi wrote:
xyx0826 wrote:This looks awesome. Seems like you figured out how the APIs work? Hoping to see more details/progress on it!!

yes sir! been spending about a month on it, got a lot of internal structures documented at this point and i found a path last night that leads to a directsoundbuffer->lock()


When you do release this, can you please explain how you went about it so the rest of us noobs can learn? :D

absolutely. i've been trying to figure out how ill do a write up and i realized i would do a write up on the process of how i did the analysis in the first place.
zuronaught
Posts: 12
Joined: Sun Mar 03, 2019 4:17 am

Re: Apex Legends .MSTR

Post by zuronaught »

Lyxi wrote:
zuronaught wrote:
Lyxi wrote:yes sir! been spending about a month on it, got a lot of internal structures documented at this point and i found a path last night that leads to a directsoundbuffer->lock()


When you do release this, can you please explain how you went about it so the rest of us noobs can learn? :D

absolutely. i've been trying to figure out how ill do a write up and i realized i would do a write up on the process of how i did the analysis in the first place.


Awesome; I can't wait!
xyx0826
Posts: 26
Joined: Sat Feb 16, 2019 10:29 pm

Re: Apex Legends .MSTR

Post by xyx0826 »

Lyxi wrote:yes sir! been spending about a month on it, got a lot of internal structures documented at this point and i found a path last night that leads to a directsoundbuffer->lock()

Amazing that you got the structs figured out! :heart:
I used to work on a GUI (actually pretty decent until I bombed it with a 2.0) for Overwatch's asset extractor. I assume you're working with C++ - if you need any help on the tool or a GUI frontend please lemme know.
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

xyx0826 wrote:
Lyxi wrote:yes sir! been spending about a month on it, got a lot of internal structures documented at this point and i found a path last night that leads to a directsoundbuffer->lock()

Amazing that you got the structs figured out! :heart:
I used to work on a GUI (actually pretty decent until I bombed it with a 2.0) for Overwatch's asset extractor. I assume you're working with C++ - if you need any help on the tool or a GUI frontend please lemme know.

Thank you for your offer, I don't have any experience GUI programming in CPP, so I might ask you for that help!

Really good news, I can now play every single sound in the game (including music). I was having trouble playing things like music and dialogue quips from the AI (kill leader announcements, circle close, etc). Figured it out just a few minutes ago. At this point I just have to find the most sensible way to hook the buffer, and dump it to disk.
Durandal217
Posts: 31
Joined: Sun Apr 10, 2016 3:54 pm

Re: Apex Legends .MSTR

Post by Durandal217 »

Lyxi wrote:
xyx0826 wrote:
Lyxi wrote:yes sir! been spending about a month on it, got a lot of internal structures documented at this point and i found a path last night that leads to a directsoundbuffer->lock()

Amazing that you got the structs figured out! :heart:
I used to work on a GUI (actually pretty decent until I bombed it with a 2.0) for Overwatch's asset extractor. I assume you're working with C++ - if you need any help on the tool or a GUI frontend please lemme know.

Thank you for your offer, I don't have any experience GUI programming in CPP, so I might ask you for that help!

Really good news, I can now play every single sound in the game (including music). I was having trouble playing things like music and dialogue quips from the AI (kill leader announcements, circle close, etc). Figured it out just a few minutes ago. At this point I just have to find the most sensible way to hook the buffer, and dump it to disk.


Lyxi, you are GOD!!! If you need help testing i'd be more than happy to help! I cannot wait for the tool!
xyx0826
Posts: 26
Joined: Sat Feb 16, 2019 10:29 pm

Re: Apex Legends .MSTR

Post by xyx0826 »

Lyxi wrote:Thank you for your offer, I don't have any experience GUI programming in CPP, so I might ask you for that help!

Really good news, I can now play every single sound in the game (including music). I was having trouble playing things like music and dialogue quips from the AI (kill leader announcements, circle close, etc). Figured it out just a few minutes ago. At this point I just have to find the most sensible way to hook the buffer, and dump it to disk.

Inline hooking IDirectSoundBuffer::Unlock can probably be a way to go. I actually have a working 32-bit wrapper dll for that. If you're interested I can send the code over.
superdave3k
Posts: 3
Joined: Thu Jun 13, 2019 5:41 pm

Re: Apex Legends .MSTR

Post by superdave3k »

Very nice progress. Sorry I disappeared but glad to see you guys kept going. Real life got busy and I forgot about this thread >.<
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

Greetings, I've now finished the first beta version of my miles 10 sound dumper. I think I have most bugs ironed out, but obviously please let me know if something is broken.

In order to use the sound dumper, you'll have to place it inside the Apex Legends folder, right where r5apex.exe is. Then using the command line you can play any sound (as far as I know) and dump them.

Code: Select all

MSD                                     -- Open MSD to play sounds
MSD <EventID>                           -- Dump an event ID
MSD <EventIDStart> <EventIDEnd>         -- Dump a range of sounds, inclusive
MSD -l                                  -- Display list of all event IDs and names contained in audio files


Issues:
* Because I'm hooking into calls that fill a DirectSoundBuffer, sound data is gathered in real time. This means that dumping each event requires actually playing it. Dumping the entire event list could take quite a while, and some events don't actually end but rather loop forever (press ESC to stop recording a loop event once you've gathered enough sound data).
* Events can be composed of multiple different source material sounds that are chosen at random. For example, a taunt event might have three different voice lines but only one of them will be dumped when you request it. I don't know at the moment how to detect multiple samples, or how to select a specific one. Just something to keep in mind.

Misc:
* I think every event is playable now, but some events that are listed don't have data (eg most titanfall 2 sound events).

GitHub Source Code
Download
Last edited by Lyxi on Mon Jul 15, 2019 12:33 pm, edited 2 times in total.
Mages
Posts: 2
Joined: Thu Feb 21, 2019 6:59 pm

Re: Apex Legends .MSTR

Post by Mages »

Lyxi wrote:Greetings, I've now finished the first beta version of my miles 10 sound dumper. I think I have most bugs ironed out, but obviously please let me know if something is broken.

In order to use the sound dumper, you'll have to place it inside the Apex Legends folder, right where r5apex.exe is. Then using the command line you can play any sound (as far as I know) and dump them.

Code: Select all

MSD                                     -- Open MSD to play sounds
MSD <EventID>                           -- Dump an event ID
MSD <EventIDStart> <EventIDEnd>         -- Dump a range of sounds, inclusive
MSD -l                                  -- Display list of all event IDs and names contained in audio files


Issues:
* Because I'm hooking into calls that fill a DirectSoundBuffer, sound data is gathered in real time. This means that dumping each event requires actually playing it. Dumping the entire event list could take quite a while, and some events don't actually end but rather loop forever (press ESC to stop recording a loop event once you've gathered enough sound data).
* Events can be composed of multiple different source material sounds that are chosen at random. For example, a taunt event might have three different voice lines but only one of them will be dumped when you request it. I don't know at the moment how to detect multiple samples, or how to select a specific one. Just something to keep in mind.

Misc:
* I think every event is playable now, but some events that are listed don't have data (eg most titanfall 2 sound events).

GitHub Source Code
Download


Thanks a ton for the release! I've also been chipping away at this for a while now and it's nice to see a resolution. Looking at your finished code I was missing the WINAPI on the MilesStartup callback and I didn't get the MilesDriverCreate struct quite right. (Which is probably why I couldn't get past MilesProjectGetStatus when I was working on this).

Without running your code as I'm work, I think I remember Miles having multiple patch banks, (Titanfall 2), so it's probably worth turning IsPatched() into a loop that loads all patches for future proofing.

- Mages / Shrug~
superdave3k
Posts: 3
Joined: Thu Jun 13, 2019 5:41 pm

Re: Apex Legends .MSTR

Post by superdave3k »

A++ on this - great job, huge tool for the community and much appreciated.
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

Mages wrote:Thanks a ton for the release! I've also been chipping away at this for a while now and it's nice to see a resolution. Looking at your finished code I was missing the WINAPI on the MilesStartup callback and I didn't get the MilesDriverCreate struct quite right. (Which is probably why I couldn't get past MilesProjectGetStatus when I was working on this).

Without running your code as I'm work, I think I remember Miles having multiple patch banks, (Titanfall 2), so it's probably worth turning IsPatched() into a loop that loads all patches for future proofing.

- Mages / Shrug~

superdave3k wrote:A++ on this - great job, huge tool for the community and much appreciated.


You're welcome! I'll post some details about the internal layout of the various structs later. I'll also fix up IsPatched later 8-).

I've also pushed a minor update, see the commit log for more information.
Durandal217
Posts: 31
Joined: Sun Apr 10, 2016 3:54 pm

Re: Apex Legends .MSTR

Post by Durandal217 »

when I try to display a list of event ids and names all that keeps happening is Play Event ID: Playing 1_second_fadeout (enter negative number to stop) and it keeps looping endlessly. Is that normal?
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

Durandal217 wrote:when I try to display a list of event ids and names all that keeps happening is Play Event ID: Playing 1_second_fadeout (enter negative number to stop) and it keeps looping endlessly. Is that normal?


You're probably opening MSD and then typing in the -l command. You have to pass the -l command when you open MSD.
Durandal217
Posts: 31
Joined: Sun Apr 10, 2016 3:54 pm

Re: Apex Legends .MSTR

Post by Durandal217 »

Lyxi wrote:
Durandal217 wrote:when I try to display a list of event ids and names all that keeps happening is Play Event ID: Playing 1_second_fadeout (enter negative number to stop) and it keeps looping endlessly. Is that normal?


You're probably opening MSD and then typing in the -l command. You have to pass the -l command when you open MSD.


Ahhh ok I got it. This is absolutely amazing though, i'm still noticing some of the audio not playing though, for example
25202 is not playing for me at all.

You have made incredible progress and I hope it continues you have my utmost thanks for the work you have put into this!
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

Durandal217 wrote:
Lyxi wrote:
Durandal217 wrote:when I try to display a list of event ids and names all that keeps happening is Play Event ID: Playing 1_second_fadeout (enter negative number to stop) and it keeps looping endlessly. Is that normal?


You're probably opening MSD and then typing in the -l command. You have to pass the -l command when you open MSD.


Ahhh ok I got it. This is absolutely amazing though, i'm still noticing some of the audio not playing though, for example
25202 is not playing for me at all.

You have made incredible progress and I hope it continues you have my utmost thanks for the work you have put into this!

Thanks. Some events don't have any audio associated with them. As for 25202 (Prophet_Mvmt_BodyFall_Metalvent_3P), when I try playing and dumping it, it works for me. As far as I know, every sound that has actual data is fully playable at this point.
Durandal217
Posts: 31
Joined: Sun Apr 10, 2016 3:54 pm

Re: Apex Legends .MSTR

Post by Durandal217 »

Lyxi wrote:Thanks. Some events don't have any audio associated with them. As for 25202 (Prophet_Mvmt_BodyFall_Metalvent_3P), when I try playing and dumping it, it works for me. As far as I know, every sound that has actual data is fully playable at this point.


hmm weird, 25202 comes up as vortex_shield_loopstart_1P on mine...
Lyxi
Posts: 23
Joined: Mon Jun 24, 2019 11:10 pm

Re: Apex Legends .MSTR

Post by Lyxi »

Durandal217 wrote:
Lyxi wrote:Thanks. Some events don't have any audio associated with them. As for 25202 (Prophet_Mvmt_BodyFall_Metalvent_3P), when I try playing and dumping it, it works for me. As far as I know, every sound that has actual data is fully playable at this point.


hmm weird, 25202 comes up as vortex_shield_loopstart_1P on mine...

Ah interesting, that's 29174 for me. Maybe different language localizations shift the tags around. Playing vortex_shield_loopstart_1P makes no sound for me, but vortex_shield_loopstart_3P does (perhaps because they've decided to play the 3P variant for the local player, instead of giving them a different sound.)
Durandal217
Posts: 31
Joined: Sun Apr 10, 2016 3:54 pm

Re: Apex Legends .MSTR

Post by Durandal217 »

Lyxi wrote:
Durandal217 wrote:
Lyxi wrote:Thanks. Some events don't have any audio associated with them. As for 25202 (Prophet_Mvmt_BodyFall_Metalvent_3P), when I try playing and dumping it, it works for me. As far as I know, every sound that has actual data is fully playable at this point.


hmm weird, 25202 comes up as vortex_shield_loopstart_1P on mine...

Ah interesting, that's 29174 for me. Maybe different language localizations shift the tags around. Playing vortex_shield_loopstart_1P makes no sound for me, but vortex_shield_loopstart_3P does (perhaps because they've decided to play the 3P variant for the local player, instead of giving them a different sound.)


so now the question becomes why it is not playing. Is it possible because 1p loops may be 6 channel audio that it is not recognizing it? I haven't had the chance yet to dump the audio so i'm not sure if the tool is simply recording the playing audio or if it is saving the actual data.
JantsoP
Posts: 2
Joined: Sat Jul 13, 2019 6:16 am

Re: Apex Legends .MSTR

Post by JantsoP »

Durandal217 wrote:
Lyxi wrote:
Durandal217 wrote:
hmm weird, 25202 comes up as vortex_shield_loopstart_1P on mine...

Ah interesting, that's 29174 for me. Maybe different language localizations shift the tags around. Playing vortex_shield_loopstart_1P makes no sound for me, but vortex_shield_loopstart_3P does (perhaps because they've decided to play the 3P variant for the local player, instead of giving them a different sound.)


so now the question becomes why it is not playing. Is it possible because 1p loops may be 6 channel audio that it is not recognizing it? I haven't had the chance yet to dump the audio so i'm not sure if the tool is simply recording the playing audio or if it is saving the actual data.


I'm actually just now dumping the sounds myself. The problem is, none of them are playing anything. They are just mute .wav files. I confirmed this with Audacity.