The Witcher 3
0 of 0

File information

Last updated

Original upload

Created by

Cthulhu aka robx99

Uploaded by

robx99

Virus scan

Safe to use

Tags for this mod

About this mod

Sound editing tools for The Witcher 3

Requirements
Permissions and credits
Changelogs
Usage:

  • Unpack the game's soundspc.cache files to a custom folder using QuickBMS with the witcher3.bms script provided here (this one supports 64-bits files used by Blood and Wine).
  • Unpack the game's XML files with the official mod tools or QuickBMS.
  • Open "soundbanksinfo.xml" with a text editor and find the sound ID and soundbanks for the sound(s) you want to replace (make sure to note them all down).
  • Make a new clean WAVE (wav) file for the sound you want to add to the game. Must be 16-bits or greater, uncompressed and have no cue chunk.
  • Run prepare_wave.py to prepare your WAVE for Wwise.
  • Open Wwise, create a new project, change project settings/source to Vorbis High, import your prepared WAVE and convert all audio files.
  • Go to your Wwise project folder/.cache and copy all your new WEM files to a folder.
  • Run compare_wem.py for each WEM file (comparing them against an original WEM file from The Witcher 3) and answer yes to the request to merge headers.
  • Copy all merged files to an empty folder and remove ".merged" from their names.
  • Rebuild the soundbanks using rebuild_soundbank.py.
  • Copy all rebuilt soundbanks to the aforementioned folder above, removing .rebuilt from its name.
  • Run create_sounds_cache.py on the folder with the modified files (.wems and .bnks).
  • Apply the new generated soundspc.cache to <The Witcher 3 Folder>/Mods/modMyMod/content.


Warning: Do not pack .wem files inside your soundspc.cache IF your .wem file is a sound, not a music. Sounds are embedded within the soundbank itself. Packing the .wem file won't cause any issues, but it will increase the overall size of your soundspc.cache (the sound file will be included twice, one as a separate .wem file and one embedded within the soundbank).

Example:

Replaces all Gwent songs with a new one:

Sound IDs: 552019, 3961972, 9131862, 10122256 and 13090987
Soundbanks: music_kaer_morhen, music_misty_island, music_nomansgrad, music_prologue, music_skellige, music_wyzima_castle

*Covert my new song to a clean wav*
prepare_wave.py my_new_song.wav 0
rename my_new_song.wav.cued my_new_song.wav
*Create my new WEM file from my_new_song.wav using Wwise*
compare_wem.py 552019.wem my_new_song.wem
copy my_new_song.wem.merged folder/552019.wem
copy my_new_song.wem.merged folder/3961972.wem
copy my_new_song.wem.merged folder/9131862.wem
copy my_new_song.wem.merged folder/10122256.wem
copy my_new_song.wem.merged folder/13090987.wem
rebuild_soundbank.py --music music_kaer_morhen.bnk folder/552019.wem
rebuild_soundbank.py --music music_kaer_morhen.bnk.rebuilt folder/3961972.wem
rebuild_soundbank.py --music music_kaer_morhen.bnk.rebuilt folder/9131862.wem
rebuild_soundbank.py --music music_kaer_morhen.bnk.rebuilt folder/10122256.wem
rebuild_soundbank.py --music music_kaer_morhen.bnk.rebuilt folder/13090987.wem
copy music_kaer_morhen.bnk.rebuilt folder/music_kaer_morhen.bnk
rebuild_soundbank.py --music music_misty_island.bnk folder/552019.wem
rebuild_soundbank.py --music music_misty_island.bnk.rebuilt folder/3961972.wem
rebuild_soundbank.py --music music_misty_island.bnk.rebuilt folder/9131862.wem
rebuild_soundbank.py --music music_misty_island.bnk.rebuilt folder/10122256.wem
rebuild_soundbank.py --music music_misty_island.bnk.rebuilt folder/13090987.wem
copy music_misty_island.bnk.rebuilt folder/music_misty_island.bnk
rebuild_soundbank.py --music music_nomansgrad.bnk folder/552019.wem
rebuild_soundbank.py --music music_nomansgrad.bnk.rebuilt folder/3961972.wem
rebuild_soundbank.py --music music_nomansgrad.bnk.rebuilt folder/9131862.wem
rebuild_soundbank.py --music music_nomansgrad.bnk.rebuilt folder/10122256.wem
rebuild_soundbank.py --music music_nomansgrad.bnk.rebuilt folder/13090987.wem
copy music_nomansgrad.bnk.rebuilt folder/music_nomansgrad.bnk
rebuild_soundbank.py --music music_prologue.bnk folder/552019.wem
rebuild_soundbank.py --music music_prologue.bnk.rebuilt folder/3961972.wem
rebuild_soundbank.py --music music_prologue.bnk.rebuilt folder/9131862.wem
rebuild_soundbank.py --music music_prologue.bnk.rebuilt folder/10122256.wem
rebuild_soundbank.py --music music_prologue.bnk.rebuilt folder/13090987.wem
copy music_prologue.bnk.rebuilt folder/music_prologue.bnk
rebuild_soundbank.py --music music_skellige.bnk folder/552019.wem
rebuild_soundbank.py --music music_skellige.bnk.rebuilt folder/3961972.wem
rebuild_soundbank.py --music music_skellige.bnk.rebuilt folder/9131862.wem
rebuild_soundbank.py --music music_skellige.bnk.rebuilt folder/10122256.wem
rebuild_soundbank.py --music music_skellige.bnk.rebuilt folder/13090987.wem
copy music_skellige.bnk.rebuilt folder/music_skellige.bnk
rebuild_soundbank.py --music music_wyzima_castle.bnk folder/552019.wem
rebuild_soundbank.py --music music_wyzima_castle.bnk.rebuilt folder/3961972.wem
rebuild_soundbank.py --music music_wyzima_castle.bnk.rebuilt folder/9131862.wem
rebuild_soundbank.py --music music_wyzima_castle.bnk.rebuilt folder/10122256.wem
rebuild_soundbank.py --music music_wyzima_castle.bnk.rebuilt folder/13090987.wem
copy music_wyzima_castle.bnk.rebuilt folder/music_wyzima_castle.bnk
create_sounds_cache.py folder


Here is a simple batch script to automatize rebuilding soundbanks with multiple soundbanks/sounds.

Sound:

for %%a in (bnks\*.bnk) do (
rebuild_soundbank.py "%%a" wems > nul 2>> bnklog.txt
move /y "%%a.rebuilt" "%%a"
)


Music:

for %%f in (wems\*.wem) do (
for %%a in (bnks\*.bnk) do (
rebuild_soundbank.py --music "%%a" "%%f" > nul 2>> bnklog.txt
move /y "%%a.rebuilt" "%%a"
)
)


Just put your soundbanks into the folder bnks and your sounds into the folder wems.

For rebuilding the soundbanks for sounds instead of music, use:

rebuild_soundbank.py soundbank.bnk folder

rebuild_soundbank.py is capable of manipulating the game's playlist, which among other things, allows you to add new songs instead of replacing old one.
The process is complex though and won't be covered here.
The commands required for doing so are:

rebuild_soundbank.py --add-new-music soundbank.bnk music.wem

Adds a new music entry to soundbank.bnk linked to your new music.wem.

rebuild_soundbank.py --playlist-id-from-track soundbank.bnk soundID

Gets the playlist ID(s) containing a sound ID. This is necessary to find which playlist(s) plays a certain music.

rebuild_soundbank.py --export-playlist soundbank.bnk playlistID

Exports a playlist settings to an INI file for manipulation.

rebuild_soundbank.py --reimport-playlist soundbank.bnk playlistID

Reimports a playlist from the INI file, overriding the previous/original one.

Finding a sound ID from its event name:

Open soundbanks/pc/soundbanksinfo.xml with a text editor.

Find the soundbank entry containing the event.
Ex:
<SoundBank Id="915214414" Language="SFX">
<ShortName>gui</ShortName>
<Path>gui.bnk</Path>


Find the event within the soundbank entry.
Ex:
<Event Id="2148708021" Name="gui_alchemy_brew" />

Copy the event's ID, in this case 2148708021.

Run rebuild_soundbank.py as --debug-event.
Ex:
rebuild_soundbank.py --debug-event gui.bnk 2148708021

Copy the resulting Audio ID (this is the sound ID).

Converting WEM(s) to OGG(s):

First open a text editor and create a new text document.
In this document create a list with the WEM IDs to be converted.

*:*
This list entry will copy and convert every single WEM within the pointed source directory with no renaming.

ID:*
This list entry will copy and convert <ID> within the pointed source directory with no renaming.

ID:NAME
This list entry will copy and convert <ID> within the pointed source directory and then rename the converted file from <ID>.ogg to <NAME>.ogg.

Ex:
138560984:gui_inventory_steelsword_attach
991887147:gui_inventory_silversword_attach
874566158:gui_inventory_weapon_attach
920045867:gui_inventory_armor_attach
1043008252:gui_inventory_pants_attach
645821961:gui_inventory_boots_attach
480599866:gui_inventory_gauntlet_attach
833488867:gui_inventory_bombs_attach
139040191:gui_inventory_ranged_attach
853240038:gui_pick_up_herbs_1
205998467:gui_pick_up_herbs_2
602135399:gui_pick_up_herbs_3
831709193:gui_pick_up_herbs_4
48037974:gui_inventory_horse_attach
114111478:gui_inventory_other_attach
*:*

In this example, we will copy and convert every WEM in the pointed source directory.
However, we will also rename the specified IDs to these specified names.

Now run ww2ogg.py with your list.
Ex:
ww2ogg.py list.txt "My WEMs" "My WEMs Converted"

Extra Information:

Original link:  Official The Witcher 3 Forums

Added to Nexus for preservation.