Music Storage
Like many other games, Genshin Impact stores audio files using Audiokinetic Wwise. Unlike the techniques used for Asset Storage (textures, models, etc.), the storage of audio is not intended to be deliberately obfuscated or difficult - it just uses a niche toolchain that is difficult to research. Thankfully however, due to Wwise's widespread usage in video games, several tools exist.
Genshin Impact stores audio as .wem
files, a proprietary Wwise format, compressed within Wwise audio packages using the file extension .pck
. These packages can be identified by the mark 41 4B 50 4B
("AKPK") at the start of the file. Genshin Impact's audio packages are located within the StreamingAssets/AudioAssets
directory.
Package Extraction
Wwise's .pck
audio packages simply contain multiple WEM audio files concatenated together. WEM audio files appear to be an extension of the extremely common WAVE format, which is itself an implementation of the RIFF format. Due to this, all WEM audio files start with the four byte header 52 49 46 46
("RIFF"). Wwise audio packages do not compress these files, and it is trivial to extract WEM audio files from an audio package.
Sample Java program for the extraction of WEM audio files from an audio package.
Audio Conversion
Since the WEM audio format is obscure and proprietary, it must first be converted to a standard format before being played. The best way to do this is via the ww2ogg utility. ww2ogg is built for Windows only, but runs perfectly under Wine. When extracting audio from Genshin Impact, the --pcb packed_codebooks_aoTuV_603.bin
flag must be used.
Tools
- hpxro7/wwiseutil, a collection of generic Wwise utilities
- Vexti/Wwise-Unpacker, a generic Wwise unpacker
- hcs64/ww2ogg, a generic Wwise WEM -> OGG converter