Cyberpunk 2077
0 of 0

File information

Last updated

Original upload

Created by

YG

Uploaded by

hgyi56

Virus scan

Safe to use

About this mod

This script is an all-in-one solution for modders who want to work with OPUSPAK and WEM files and/or get the IDs and audio data associated with sound effects or musics.

Requirements
Permissions and credits
Changelogs

DESCRIPTION
This script is an all-in-one solution for modders who want to work with OPUSPAK and WEM files and/or get the IDs and audio data associated with sound effects or musics.

You can extract any sound effect from the game into a set of WAV files. Then do your work on these WAV files and use the script again to import your modified WAV files into OPUSPAKs along with the OPUSINFO file update. Finally put the generated OPUSPAKs and OPUSINFO into your mod.

Credits: to HitmanHimself and his Cyberpunk Opuspak Tool that is based on the WolvenKit C# source code to extract and update source IDs from the OPUSPAK files. I translated this into Python and I created my events resolution layer on it in order to make an all-in-one solution that can be used easily on all platforms.

USAGE



REQUIREMENTS
  • Python: v3.12.0 (download link).
  • Python libraries: lxml, numpy, jsonpath-ng. Install them using "pip" see below.
  • Opus codec for OPUSPAK from/to WAV conversion. Already embedded for Windows, otherwise download it here.
  • vgmstream for WEM to WAV conversion. Already embedded for Windows, otherwise download it here and build it.

INSTALLATION
1. Extract the "SoundFX Search and Update" folder on your computer.

2. Install Python with its additional content "pip" to install libraries, and "tcl/tk and IDLE" if you want to generate XML banks by yourself otherwise download them directly from the optional files section and don't install "tcl/tk and IDLE".

3. Install required Python libraries using a cmd.exe window:
pip install lxml numpy jsonpath-ng


How to get the required "events_to_lookup" file: this is a simple text file that must contain one event by line. You can find events by searching into the "eventsmetadata.json" file with a good text editor like Sublime Text that allows you to search using regexp and to select all results at once, sort lines, and uniquify lines.

Example of events file (lines with '==' don't exist):
== begin_file ==
mus_ow_valentinos_stealth
av_maxtac_start_descent
amb_q305_inner_bunker_blackout_siren
ui_phone_sms
== end_file ==

How to get the required "events_catalog" file: the game contains a binary file called "eventsmetadata.json" in the following internal path "base\sound\event".
You need to use WolvenKit in order to extract and convert it into readable JSON on your computer.
Then pass the readable JSON file to the script using the argument --events_catalog.

You can also download it from the optional files section.

How to get the required "soundbanks" folder: the game in v2.12 contains 1878 OPUSPAK files, 1 OPUSINFO file and 4796 WEM files into the internal path "base\sound\soundbanks".
You need to use WolvenKit in order to extract all these files into a folder on your computer.
Then pass this folder to the script using the argument --soundbanks.

How to get the required "xml" folder: the game contains sound bank (*.bnk) files into the internal path "base\sound\soundbanks". We will use two of them "sfx_container.bnk" and "cp_music.bnk".

We need wwiser tool in order to convert BNK files into XML readable files.
You can either download them directly from the optional files section or you can generate them by yourself following the instructions below.

Download and extract wwiser somewhere.
Then open the wwiser folder (named wwiser-master) and execute the command 'py build.py' into a cmd.exe window so Python will create an executable.

The executable will be created in 'bin\wwiser.pyz'. You can then double-click on this file to open wwiser as a graphical interface. This is why you need to include the "tcl/tk and IDLE" additional content during Python installation. These libraries are required in order to run a graphical interface.

In the wwiser window, load the 'sfx_container.bnk' file with the button [Load banks...] and wait for the process to finish. Then click on [Dump banks...] and wait for the XML file to be created. Then select the loaded bank in the upper list and click on [Unload banks].

Repeat this step with 'cp_music.bnk'. Do not regroup BNK files into a single XML file as the script will not handle it. You must have one XML file per BNK file.
Place these two XML files into a folder that you will pass to the script using the argument --xml.

SCRIPT ARGUMENTS

To display additional help about the script arguments use the following command in a cmd.exe:
py soundfx_search_and_update.py -h

SUPPORT
Feel free to contact me in case something does not work as expected so I can investigate.
Use the POSTS tab and describe your issue with as many details as you can.


MY MODS

MY TOOL FOR MODDERS