[decompiler] Extracting Sound Effects and Music (#4401)

This PR adds the ability to extract sound effects to .wav files for each
of the four games, and music to .wav files for Jak1 and Jak2.

Basically what I have done is create a "fake player" which works the
same as the player from Player.cpp except we just take the raw audio
samples that would be sent to cubeb and then write them to wave files.

I shamelessly stole @Hat-Kid's code for flavas, for parsing the sound
effect names and for finding where the sound banks start for Jak 1 lol.
This commit is contained in:
Jordan
2026-09-17 01:29:11 +02:00
committed by GitHub
parent 613a8b22cd
commit 76e4bcb8bc
16 changed files with 655 additions and 15 deletions
+12 -3
View File
@@ -308,11 +308,20 @@ int run_decompilation_process(decompiler::Config config,
lg::info("[Mem] After extraction: {} MB", get_peak_rss() / (1024 * 1024));
if (config.rip_streamed_audio) {
if (config.rip_streamed_audio || config.rip_music) {
auto streaming_audio_out = out_folder / "audio";
file_util::create_dir_if_needed(streaming_audio_out);
process_streamed_audio(config, streaming_audio_out, in_folder,
config.streamed_audio_file_names);
if (config.rip_streamed_audio) {
process_streamed_audio(config, streaming_audio_out / "voice_lines", in_folder,
config.streamed_audio_file_names);
process_sfx(streaming_audio_out / "sfx", in_folder);
}
// Rip music for jak 1 or jak 2
if (config.rip_music &&
(config.game_version == GameVersion::Jak1 || config.game_version == GameVersion::Jak2)) {
process_music(streaming_audio_out / "music", in_folder);
}
}
lg::info("Decompiler has finished successfully in {:.2f} seconds.", decomp_timer.getSeconds());