diff --git a/common/util/os.cpp b/common/util/os.cpp index 7ca8ef195..397a0b62f 100644 --- a/common/util/os.cpp +++ b/common/util/os.cpp @@ -26,9 +26,6 @@ size_t get_peak_rss() { getrusage(RUSAGE_SELF, &x); return x.ru_maxrss * 1024; } -size_t get_peak_rss() { - return 0; -} #endif #ifdef _WIN32 diff --git a/decompiler/config.cpp b/decompiler/config.cpp index d0d7d9127..a47df7c4b 100644 --- a/decompiler/config.cpp +++ b/decompiler/config.cpp @@ -64,7 +64,6 @@ Config make_config_via_json(nlohmann::json& json) { inputs_json.at("str_art_file_names").get>(); } - config.audio_dir_file_name = inputs_json.at("audio_dir_file_name").get(); config.streamed_audio_file_names = inputs_json.at("streamed_audio_file_names").get>(); @@ -321,6 +320,9 @@ Config make_config_via_json(nlohmann::json& json) { if (json.contains("save_texture_pngs")) { config.save_texture_pngs = json.at("save_texture_pngs").get(); } + if (json.contains("rip_streamed_audio")) { + config.rip_streamed_audio = json.at("rip_streamed_audio").get(); + } if (inputs_json.contains("animated_textures")) { config.animated_textures = diff --git a/decompiler/config.h b/decompiler/config.h index 9516a212a..7ac7793a2 100644 --- a/decompiler/config.h +++ b/decompiler/config.h @@ -102,8 +102,6 @@ struct Config { std::vector str_file_names; std::vector str_texture_file_names; std::vector str_art_file_names; - - std::string audio_dir_file_name; std::vector streamed_audio_file_names; std::string obj_file_name_map_file; @@ -175,6 +173,7 @@ struct Config { std::vector levels_to_extract; bool levels_extract; bool save_texture_pngs = false; + bool rip_streamed_audio = false; DecompileHacks hacks; diff --git a/decompiler/config/jak1/jak1_config.jsonc b/decompiler/config/jak1/jak1_config.jsonc index 85e7c3edf..ed1be8159 100644 --- a/decompiler/config/jak1/jak1_config.jsonc +++ b/decompiler/config/jak1/jak1_config.jsonc @@ -122,6 +122,9 @@ // save game textures as .png files to decompiler_out//textures "save_texture_pngs": false, + // whether or not to dump out streamed audio files to decompiler_out//audio + "rip_streamed_audio": false, + //////////////////////////// // PATCHING OPTIONS //////////////////////////// diff --git a/decompiler/config/jak1/ntsc_v1/inputs.jsonc b/decompiler/config/jak1/ntsc_v1/inputs.jsonc index afe79b72f..4e9b44f5c 100644 --- a/decompiler/config/jak1/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak1/ntsc_v1/inputs.jsonc @@ -258,10 +258,6 @@ "TEXT/6COMMON.TXT" ], - // uncomment the next line to extract audio to wave files. - //"audio_dir_file_name": "jak1/VAG", - "audio_dir_file_name": "", - "streamed_audio_file_names": [ "VAGWAD.ENG", "VAGWAD.FRE", diff --git a/decompiler/config/jak1_demo/default/inputs.jsonc b/decompiler/config/jak1_demo/default/inputs.jsonc index 4438a5472..e78766381 100644 --- a/decompiler/config/jak1_demo/default/inputs.jsonc +++ b/decompiler/config/jak1_demo/default/inputs.jsonc @@ -228,9 +228,5 @@ "TEXT/6COMMON.TXT" ], - // uncomment the next line to extract audio to wave files. - //"audio_dir_file_name": "jak1/VAG", - "audio_dir_file_name": "", - "streamed_audio_file_names": ["VAGWAD.ENG", "VAGWAD.JAP"] } diff --git a/decompiler/config/jak2/jak2_config.jsonc b/decompiler/config/jak2/jak2_config.jsonc index 460731425..2965d2de5 100644 --- a/decompiler/config/jak2/jak2_config.jsonc +++ b/decompiler/config/jak2/jak2_config.jsonc @@ -127,6 +127,9 @@ "rip_collision": false, // save game textures as .png files to decompiler_out//textures "save_texture_pngs": false, + + // whether or not to dump out streamed audio files to decompiler_out//audio + "rip_streamed_audio": false, //////////////////////////// // PATCHING OPTIONS diff --git a/decompiler/config/jak2/ntsc_v1/inputs.jsonc b/decompiler/config/jak2/ntsc_v1/inputs.jsonc index 8d9da73f7..d6876bccd 100644 --- a/decompiler/config/jak2/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak2/ntsc_v1/inputs.jsonc @@ -441,10 +441,6 @@ "TEXT/7COMMON.TXT" ], - // uncomment the next line to extract audio to wave files. - // "audio_dir_file_name": "jak2/VAG", - "audio_dir_file_name": "", - "streamed_audio_file_names": [ "VAGWAD.ENG", "VAGWAD.FRE", diff --git a/decompiler/config/jak3/jak3_config.jsonc b/decompiler/config/jak3/jak3_config.jsonc index 3377deaca..710820c0c 100644 --- a/decompiler/config/jak3/jak3_config.jsonc +++ b/decompiler/config/jak3/jak3_config.jsonc @@ -127,6 +127,9 @@ // save game textures as .png files to decompiler_out//textures "save_texture_pngs": false, + // whether or not to dump out streamed audio files to decompiler_out//audio + "rip_streamed_audio": false, + //////////////////////////// // PATCHING OPTIONS //////////////////////////// diff --git a/decompiler/config/jak3/ntsc_v1/inputs.jsonc b/decompiler/config/jak3/ntsc_v1/inputs.jsonc index fa1f68915..44f630845 100644 --- a/decompiler/config/jak3/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak3/ntsc_v1/inputs.jsonc @@ -333,10 +333,6 @@ "TEXT/11COMMON.TXT" ], - // uncomment the next line to extract audio to wave files. - // "audio_dir_file_name": "jak3/VAG", - "audio_dir_file_name": "", - "streamed_audio_file_names": [ "VAGWAD.ENG", "VAGWAD.FRE", diff --git a/decompiler/decompilation_process.cpp b/decompiler/decompilation_process.cpp index 7217545de..5e6db14d4 100644 --- a/decompiler/decompilation_process.cpp +++ b/decompiler/decompilation_process.cpp @@ -272,9 +272,9 @@ int run_decompilation_process(decompiler::Config config, lg::info("[Mem] After extraction: {} MB", get_peak_rss() / (1024 * 1024)); - if (!config.audio_dir_file_name.empty()) { + if (config.rip_streamed_audio) { auto streaming_audio_in = in_folder / "VAG"; - auto streaming_audio_out = out_folder / "assets" / "streaming_audio"; + 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);