A Basic guide on the different ways to play a sound effect in-game
This is a very basic tutorial so you don't need much knowledge to do it successfully.
Wolven kit
Any text editor capable of opening a big JSON file without crashing
That's about it.
This tutorial presumes that you already have a mod project in WolvenKit and will not walk you through how to create one.
If you don't have redscripts in your project, you will need to add the following structure to your resources folder inside your mod folder:
There are 3 documented ways to play sounds using scripting. Two are linked to the event system and the third one is linked to a helper function:
If you try to run the script now it will most likely fail because you don't have the player object used to queue or play the event.
So how to get the player?
It's actually quite easy, once a save has been loaded, you can simply use:
You are not even obligated to get the player. You can use any GameObject
capable of handling events in the event way and you can use any GameObject
at all using the helper function. If it isn't valid, the GameObject
method will use the game engine to play the sound. (It will not be spatialized this way)
If you did everything correctly, your sound should be played in the part of the script where you used it.
And now, you will probably want to play other sounds. Sounds played by the game are referenced using a redIdentifier.
To find many of these identifiers for sounds, you will need to use WolvenKit and navigate to:
You can then import it into your project, turn it into JSON and explore the JSON file to find all the tags, for example:
Use any of these IDs and experiment!
There is a lot of them so use string search to find them more quickly. You can also search for them in the events
array for an easier search with tags.
Section of guides on how to change sounds in Cyberpunk 2077.
This section contains guide about changing sounds in the game.
If you wish to read about how the game handles audio see the theoretical page.
There are a couple of pages about sounds on wiki for his Addicted Mod:
https://cyb3rpsych0s1s.github.io/4ddicted/cheatsheet/sounds.html https://cyb3rpsych0s1s.github.io/4ddicted/travelog/2023-03-31.html
Bioskop's comprehensive guide to vocoding - Google Docs
Last, but not least, you can now also use Audioware native plugin to add, customize and play custom sounds at your convenience with scripts. Audioware also provides its guide to get you up-and-running in no-time!
How to mod audio using eventmetadata.json
Published: May, 2024 by Darckray Last documented update: June 8, 2024 by Zhincore
This guide explains ways to edit game's sounds by changing eventsmetdata.json
file. Such changes are incompatible with other mods that modify sounds but is the most powerful way.
If you need to make compatible changes like muting a sound or adding a custom one see the REDmod guide instead:
This is by far the easiest edit as long as you know what you want to change, and all you need is wolvenkit and notepad. Right click eventsmetadata.json in wolvenkit and click on 'convert to json', this will make the file readable. Now, open up eventsmetadata.json.json in notepad and look for the events that have the sound that you need, for example, you can press CTRL+F and search for w_melee_blunt_impact_bat.
You'll see isLooping
, maxAttenuation
, maxDuration
, minDuration
(see below for information on these) and the event name, as well as the WWise ID right at the end. Copy this ID.
Now, say that you want another melee weapon to sound like a baseball bat, all you have to do is to look for the event that has the sound you want to change for that weapon as outlined above and replace the ID with the one you copied earlier for all the events with that name. Save your changes and right click on eventsmetadata.json.json in wolvenkit and click on convert from json, pack your mod, install it and your melee weapon should now sound like a baseball bat!!
Note that you should prefer using the REDmod method instead for this task.
Add eventsmetadata.json to your wolvenkit project, right click on it inside your project and click on 'convert to json', then open the resulting eventsmetadata.json.json in notepad and look for the event that has the sounds you want to mute with CTRL+F. After you've found it, look for its WWise ID and set it to 0, save the file, right click on it in your project again, click on convert from json and pack your mod. Any sounds associated to the event you edited should now be muted.
The information that follows is the result of what was observed during testing and has not been fully confirmed as of February 16, 2024.
isLooping
: whether or not the sound will loop, can be set to 0 or 1.
maxAttenuation
: controls the loss of energy a sound will experience the further it travels. It is not known whether this property has an impact on how loud a sound is or how different environments make it behave, but it is speculated that the higher the maxAttenuation the further the sound can travel before it can't be heard anymore. Can be set to any value from 0 to 1000.
maxDuration
: the amount of time a sound plays for before it stops.
minDuration
: the minimum amount of time a sound has to be played for before the game can stop it.
How to play custom sounds (effects, dialogue, music) from custom emitters, using Audioware, and without REDmod.
Before getting started, it's important to note that all the information below (and much more) can be found on the . This is a very basic guide. At the time of writing this, , by , is in version 1.0.2. This guide was written by .
Proceeding through the example below will require a basic familiarity with , and you will need to have and its prerequisite mods (, etc.) installed.
Perhaps you want radios to play a sound effect when they're switched off? Or citizens to spout angry dialogue at V when she steals their vehicle? Or vending machines to play music to entice you to purchase Night City's terrible mass-produced food or drink options?—You'll want to brainstorm your specific implementation before proceeding. If you're not sure if an idea is feasible, ask around on the modding Discord. Someone ought to know what method you can wrap to achieve your specific goal.
It's likelier, however, that you'll develop a mod that is wholly unrelated to audio, and want to spice it up afterward with some sound. Perhaps you've authored a new gun mod, and you'd like the gun to play a sound effect when it powers down? Or perhaps you'd like your new helmet mod to play a filtered breathing sound at intervals? Or perhaps you want your new jewelry mod to jingle on occasion. You'll find it beneficial to have a goal in mind at this point.
After you have a solid idea, you'll need sound files. You can find free sounds on the internet (perhaps ) or . The has a list of sound formats that are compatible. (mp3, wav, ogg, flac, currently.)
Don't forget to save the names of the sounds' creators, as well as their URLs. Always credit others' work, if you're going to use it.
In the basic example below, we'll register Cyberpunk's android entities to play sound effects, when they're struck. We'll call the mod Android_Malfunction. It's good to have a unique mod title in mind right away, because in the next steps, we'll appropriately name files, folders, and so forth.
Your mod is going to have the following folder structure, wherein YourMod represents your mod's unique title (and perhaps your module's name, for consistency) and SoundName represents whatever you decide to name your sound(s):
Your sound files and your sound manifest (a .yml or .yaml file) will be located in: resources\r6\audioware\YourMod\
Your Redscript (.reds) file will be located in: resources\r6\scripts\YourMod\
That said, our list of files will be:
resources\r6\audioware\Android_Malfunction\SoundName.mp3/.wav/.ogg/.flac
resources\r6\audioware\Android_Malfunction\Android_Malfunction.yaml
resources\r6\scripts\Android_Malfunction\Android_Malfunction.reds
Without further delay, here's the Audioware manifest we'll be using, containing five sound effects:
The version line is required, and should be set to 1.0.0. And we have a sound effects (sfx) section that lists the sounds we'll be using. We're specifying that they should be played at 1.0 (100%) volume, 0.5 (50%) volume, or 1.5 (150%) volume, depending on the sound. Everything is named very simply and everything is indented properly (spaces, not tabs; 2 per indent).
Our first line of code is always our module name:
Next, our imports, for relevant prerequisite mods:
We're going to "cheat" a bit here—for the sake of brevity and shorter code—and register the entities as emitters immediately before playing a sound effect. Audioware does allow this. We just have to make sure we aren't registering entities multiple times each.
And here's the function we'll wrap, to register our androids as emitters and play one of our sounds, when they are struck in combat—study it for a second before proceeding—because it has a problem that we'll address in the next step:
Did you notice the problem above?—Suppose an android is repeatedly hit, such as by a high fire-rate weapon?—Our resulting sound effects will immediately overlap one another and sound cacophonous. We need to alleviate that.
We'll do this using one of Redscript's greatest assets to audio modding: a callback. Our callback will take two variables: the audioware system and the android's entityID. We'll also be creating a field, to hold the DelayID of the callback, which we'll update, per callback. Here's all that:
Next, we have to modify the function we started with above, to execute the callback we just wrote. So let's update it, as follows:
Not terribly different; not terribly difficult. You'll notice we're incrementing the callback's delay by 0.75 (seconds), each subsequent hit, while there's a callback ongoing—you can substitute any number there instead, based on factors of your choosing (such as what your sound effects sound like together, or their average lengths). For our purposes, we want our androids to sound like they're experiencing awful electronic destruction, but not too much, so this amount will do fine.
It's also worth noting here that you can and should use 0.0 for a next-frame callback instead of DelayCallbackNextFrame(), which we do here when an android is hit for the first time.
Finally, let's have a look at the complete script:
Small guide on how to find the in-game sound you're searching for.
Published: ??? by Xotak Overhauled: June 8, 2024 by Zhincore
This guide explains how to use , an open source web tool made by Zhincore (@zhincore on ).
In the you can search for sounds by events, tags or sound hash or using the filtering options. Once you find what you're searching for, open the detail window by clicking on the list item, there you can find where the files is located.
Sounds inside .opuspak
can be extracted using .
Sounds in a "Separate .wem file" can be simply found in by the sound's hash.
If the sound is marked a virtual or nonexistent, you're out of luck for now and must find other way. Perhaps your wanted sound is a voice-over and you can find it using the section described bellow.
The allows you to search for the game's voice-overs using their subtitles, by quest ID or other filtering options. Again, once you find what you need, click on it to open the detail window.
Usually you want the path to the voice-over audio, if no audio was found, it probably doesn't exist in the game (otherwise ping @zhincore that it's missing). If it was found, it might've been found in various forms, for male vs. female V and in normal, holocall or helmet variant. Choose the one you want and click on it's path to copy it. This will give you the exact path that you can paste into WolvenKit to find that file. If you want different localization than en-us, change it in the path (e.g. to fr-fr
).
If you want the subtitles itself, if it was found, click on the "Subtitles found in" path to copy it, you can find the file in WolvenKit using the path and using the String ID you can find the specific line.
Guide on how to replace a sound effect using WolvenKit without REDmod
Published: June 9, 2024 by Zhincore
This guide covers how to export and import sound effects using WolvenKit by modifying opusinfo/opuspaks.
This method is not compatible with other mods that change sounds this way, that's why you should prefer using or (custom audio backend).
In order to be able to export sound effects, you must first add sfx_container.opusinfo
to your project. Find that file in the Asset browser using and double click it to add it.
Hash is basically an ID of a sound. To find the hashes you need, you can use the .
Once you have opusinfo in your project (1), it should appear in the Export tool (top menu -> Tools -> Export tool), if not, try pressing the Refresh button. Select the sfx_container (2) and in the options on the right click the three dots next to "Selected for Export" (3). A new window will popup (4), there you choose what hashes/sounds you want to export.
For a little more detailed walk-through see:
And by "it", haha, well... Let's justr say... Sound effects.
Once you've selected your hashes and pressed "Finish", you can press the Export button. Once that's done you will now have your sounds exported in the raw folder of your project. You will two files per hash/sound, one is .opus
and second is .wav
. You can now modify the .wav sound to your liking, just preserve it's name and location!
Open the Import tool (top menu -> Tools -> Import tool).
Select your sounds you want to import.
Press "Import selected" (or all, whichever suits you)
You can usually leave the default settings as is. And your mod is done! Test it out.
You can find the mod's complete files , and play with it yourself, if you'd like.
And that's all there is to it, really, but again: you should familiarize yourself with the , and play around with the many options and settings made available to you.
The author, , worked very hard on the mod for a very long time, so perhaps contact him with any feedback or feature requests you may have. It could improve things for many other authors.
Using this method you can only replace existing sounds. To add new ones use the or .
Importing sound effects is mostly straightforward. Simply put your sounds in your project's raw\base
folder. The sound must be in .wav
format and it's file name must be exact hash of an existing sound. Best bet is .
Mods made this way are incompatible with each other! You should prefer using if possible.