Skip to main content
The PCK Handler provides two main classes for working with Wwise PCK (Package) files: PCKExtractor for extracting audio and PCKPacker for creating modified PCKs.

PCKExtractor

Extracts WEM and BNK files from Wwise PCK archives.

Constructor

from src.pck_extractor import PCKExtractor

extractor = PCKExtractor(pck_path)
pck_path
str | Path
required
Path to the PCK file to extract.

Methods

parse_header

Parses the PCK file header and indexes all files.
files_info = extractor.parse_header()
files_info
list[dict]
List of file information dictionaries, each containing:
  • id (int): File ID (WEM ID)
  • offset (int): Byte offset in PCK
  • size (int): File size in bytes
  • lang_id (int): Language ID (0=SFX, 1=English, 2=Chinese, etc.)
  • lang_name (str): Language name string

extract_file

Extracts a single file from the PCK.
output_path = extractor.extract_file(
    file_info,
    output_dir,
    file_extension='.wem'
)
file_info
dict
required
File info dictionary from parse_header().
output_dir
str | Path
required
Directory to extract to (creates language subdirectories).
file_extension
str
default:"'.wem'"
File extension to use (.wem or .bnk).
output_path
Path
Path to the extracted file.

extract_all

Extracts all files from the PCK.
extractor.extract_all(output_dir, extract_bnk=False)
output_dir
str | Path
required
Directory to extract files to.
extract_bnk
bool
default:"False"
If True, also extract BNK (soundbank) files.
Behavior:
  • Creates subdirectories for each language (sfx, english, chinese, japanese, korean)
  • Prints progress every 100 files
  • Names files by their ID: {file_id}.wem

Language Mapping

lang_map = {
    0: 'sfx',      # Sound effects
    1: 'english',
    2: 'chinese',
    3: 'japanese',
    4: 'korean'
}

Example: Extract PCK

from src.pck_extractor import PCKExtractor
from pathlib import Path

# Extract all WEM files
extractor = PCKExtractor("Streamed_SFX_1.pck")
extractor.extract_all("./extracted")

# Result:
# extracted/
#   sfx/
#     134133939.wem
#     86631895.wem
#   english/
#     1053247613.wem

PCKPacker

Creates modified PCK files by replacing audio in existing PCKs.

Constructor

from src.pck_packer import PCKPacker

packer = PCKPacker(original_pck_path, output_pck_path)
original_pck_path
str | Path
required
Path to the original PCK file to modify.
output_pck_path
str | Path
required
Where to save the modified PCK.

Methods

load_original_pck

Loads and indexes the original PCK file.
packer.load_original_pck()
Behavior:
  • Parses PCK structure
  • Indexes all soundbanks, soundbank files, and stream files
  • Detects language mappings
  • Prints summary of loaded files

replace_file

Replaces a single WEM file by ID.
packer.replace_file(
    file_id,
    replacement_file_path,
    lang_id=0,
    target_section='soundbank_files'
)
file_id
int
required
WEM ID to replace.
replacement_file_path
str | Path
required
Path to replacement WEM file.
lang_id
int
default:"0"
Language ID (0=SFX, 1=English, etc.).
target_section
str
default:"'soundbank_files'"
Section to replace in: 'soundbank_files', 'stream_files', or 'soundbank_titles'.

replace_bnk_wems

Replaces multiple WEMs inside a BNK soundbank.
packer.replace_bnk_wems(bnk_id, bnk_wems_dir, lang_id=0)
bnk_id
int
required
BNK soundbank ID to modify.
bnk_wems_dir
str | Path
required
Directory containing WEM files named by ID (e.g., 12345.wem).
lang_id
int
default:"0"
Language ID of the BNK to modify.
Behavior:
  • Extracts original BNK from PCK
  • Replaces WEMs inside the BNK
  • Re-embeds modified BNK into PCK
  • Auto-detects correct lang_id if available

replace_files_from_directory

Batch replaces files from a directory structure.
packer.replace_files_from_directory(replacements_dir, lang_id=0)
replacements_dir
str | Path
required
Directory containing replacement files.
lang_id
int
default:"0"
Default language ID for replacements.
Directory Structure:
replacements_dir/
  134133939.wem        # Direct WEM replacement
  86631895.wem
  1234567_bnk/        # BNK modifications (directory named {bnk_id}_bnk)
    100000.wem
    100001.wem

pack

Writes the modified PCK file.
packer.pack(use_patching=True)
use_patching
bool
default:"True"
  • If True: Uses patching mode (faster, preserves original structure)
  • If False: Rebuilds entire PCK from scratch
Patching Mode:
  • Copies original PCK
  • Patches replacement files in-place
  • Fast and preserves original structure
  • Handles size differences:
    • Same size: Direct replacement
    • Smaller: Pads with zeros
    • Larger: Truncates (with warning)
Rebuild Mode:
  • Rebuilds entire PCK structure
  • Handles arbitrary size changes
  • Slower but more flexible

close

Closes all open file handles.
packer.close()

Section Types

PCK files contain three sections:
  1. soundbank_titles: BNK soundbank files
  2. soundbank_files: WEM files embedded in soundbanks
  3. stream_files: Streamed WEM files (large audio)

Example: Modify PCK

from src.pck_packer import PCKPacker

# Initialize packer
packer = PCKPacker(
    "Streamed_SFX_1.pck",
    "Streamed_SFX_1_modded.pck"
)

# Load original
packer.load_original_pck()

# Replace a single WEM
packer.replace_file(
    file_id=134133939,
    replacement_file_path="my_sound.wem",
    lang_id=0
)

# Replace WEMs in a BNK
packer.replace_bnk_wems(
    bnk_id=2471637648,
    bnk_wems_dir="./bnk_modifications/",
    lang_id=1  # English
)

# Write modified PCK (using fast patching)
packer.pack(use_patching=True)
packer.close()

print("Modified PCK created!")

Command-Line Usage

Extract PCK

python -m src.pck_extractor Streamed_SFX_1.pck ./extracted

# Also extract BNK files
python -m src.pck_extractor SoundBank_SFX_1.pck ./extracted --bnk

Create Modified PCK

python -m src.pck_packer original.pck ./replacements/ modified.pck

PCK File Format

PCK files use the Wwise AKPK format:
Header:
  Magic: AKPK (4 bytes)
  Header Size (4 bytes)
  Version (4 bytes)
  Section Sizes (3-4 x 4 bytes)

Sections:
  1. Language Definitions
  2. Soundbank Titles (BNK files)
  3. Soundbank Files (embedded WEMs)
  4. Stream Files (optional, uses 8-byte IDs)

Data:
  Raw file data at calculated offsets

Notes

  • File IDs are 32-bit unsigned integers (except stream files which use 64-bit)
  • Language ID 0 is always SFX (sound effects)
  • BNK files contain multiple WEM files and must be modified using BNKFile class
  • Patching mode is recommended for mod distribution (preserves game structure)
  • Always call packer.close() when done to release file handles

Build docs developers (and LLMs) love