# Audio files

## Summary

**Published:** June 9, 2024 **by** Zhincore

Cyberpunk uses Wwise audio system, which uses mostly proprietary ("secret", non-opensource) formats. But thanks to the community we have the tools to dig into them. This page explains the technicalities behind audio.

## Wait, that's not what I want!

Perhaps you only care about how to find or replacing audio:

{% content-ref url="../../modding-guides/sound/finding-an-audio-file" %}
[finding-an-audio-file](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/sound/finding-an-audio-file)
{% endcontent-ref %}

{% content-ref url="../../modding-guides/sound/replacing-sounds-effects" %}
[replacing-sounds-effects](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/sound/replacing-sounds-effects)
{% endcontent-ref %}

## Primary file types

There two main ways Cyberpunk 2077 stores audio:

### WEM files

The game stores **voice-overs** and most **music** as `.wem` files which are directly in the game's `.archive`s and their exporting/importing is handled as any other asset.

### Opuspaks and bnks

On the other hand **sound effects**, **grunts**, and some music are packed together in files ending with `.opuspak`. Those paks are mapped by a single `.opusinfo` file. If you want to manipulate them, check out [the guide on replacing sound effects](https://wiki.redmodding.org/cyberpunk-2077-modding/modding-guides/sound/replacing-sounds-effects).

Few sounds, mostly car noises, are so-called *preloaded* (or **embedded**) in `.bnk` files, they're mostly duplicated and can be found elsewhere, but some sounds are only preloaded. [VGMStream](https://github.com/vgmstream/vgmstream) is able to extract some of them, but not all, because they differ in audio format.

Some sounds ~~do not exist~~ are handled differently. For example generated (noise, sine wave, etc.), or generated by CDPR's custom Wwise plugins. This might require more research, but you most probably don't need those sounds anyway.

## How are SFX handled by the engine

The aforementioned .bnk files are primarily for other purpose than storing audio. They describe how and which the audio should be played.

The process of playing a sound when something happens goes something like this: The game sends an *event* to Wwise, those are described in `eventsmetadata.json` file in the game's archives. Those events are connected to a tree of nodes described in `.bnk` files, this may include random selection of next node, layering, volume modification, switching between the next nodes according to a condition, etc. At the end is a node that points to an audio file (or a plugin) and that sound is played. Or multiple sounds are played at once, according to the previous nodes.

This happens every time V has to grunt, when a weapon shoots, car starts, crashes, or when you enter a building and ominous music starts to play, that went through bnks, too! This does not seem to happen for most voice-overs (apart for exceptions, for example I think the [Konpeki Plaza alarm](https://sounddb.redmodding.org/subtitles/1674949184319180800) (voice-over) uses [CDPR's Voice Broadcast plugin](https://sounddb.redmodding.org/sfx/413736901) (SFX)).

## How are voice-overs connected to subtitles

Every subtitle in the game has a String ID (which is a really long number) that is universal between languages. What `.wem` audio file belongs to which String ID is mapped inside files starting with `voiceover` and ending in `.json`. Some of them are for holocall voice-overs, some for when the character has a helmet on. Then there is more `.json` files in the `subtitles` folders that contain the subtitles for each String ID... and by more I mean few thousands. So, again, it is easier to search those using [the SoundDB](https://sounddb.redmodding.org).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.redmodding.org/cyberpunk-2077-modding/for-mod-creators-theory/files-and-what-they-do/audio-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
