Skip to main content

WAD、BIN、BNK、WPK文件简单处理

Project description

league-tools

PyPI 版本 Python 版本 许可证 发布流程

WAD、BIN、BNK、WPK 文件处理工具库。

介绍

league-tools 是一个用于处理英雄联盟资源文件的 Python 库,提供对以下格式的底层解析能力:

  • WAD.wad.client):资源包(模型、贴图、音频等)
  • BIN.bin):游戏配置与逻辑数据
  • BNK.bnk):Wwise SoundBank 音频元数据
  • WPK.wpk):Wwise 打包音频文件

音频事件映射默认推荐使用 NativeHIRC

  • 只关注事件映射所需的 HIRC 音频信息
  • 直接从 events.bnk 读取,速度明显快于 wwiser -> XML
  • 更适合默认映射链和批量分析

如果你需要更完整的 BNK/HIRC 结构、XML 对照能力或调试信息,再使用 WwiserHIRC

安装

pip install league-tools

如需基于发布分支安装最新代码:

pip install -e "git+https://github.com/Virace/league-tools@package#egg=league_tools"

使用

基础使用示例(四种核心格式):

from pathlib import Path

from league_tools import BIN, BNK, NativeHIRC, WAD, WPK

# 1) WPK:提取音频文件
wpk = WPK("path/to/audio.wpk")
wem_files = wpk.extract_files()

# 2) BNK:提取内嵌WEM
bnk = BNK("path/to/events.bnk")
bnk_wem_files = bnk.extract_files()

# 3) WAD:按已知路径提取文件
wad = WAD("path/to/archive.wad.client")
wad.extract(
    ["assets/sounds/vo/champions/gwen/skin01/vo_gwen_skin01_events.bnk"],
    out_dir=Path("./wad_output"),
)

# 4) BIN:读取音频事件组数据
bin_file = BIN("path/to/skin.bin")
audio_groups = bin_file.data

# 5) NativeHIRC:默认推荐的 events.bnk 解析入口
hirc = NativeHIRC.from_bnk("path/to/vo_events.bnk")

日志默认关闭;上游项目可按需手动开启:

from league_tools import enable_logging, disable_logging

enable_logging()
# ... 业务逻辑 ...
disable_logging()

详细示例与格式文档:

音频映射建议

默认工作流:

from league_tools import AudioEventMapper, BIN, NativeHIRC

bin_file = BIN("path/to/skin.bin")
hirc = NativeHIRC.from_bnk("path/to/events.bnk")
mapping = AudioEventMapper(bin_file, hirc).build_mapping()

何时切到 WwiserHIRC

  • 需要完整 XML / HIRC 结构对照
  • 需要调试 wwiser 输出或排查版本差异
  • 需要的信息超出 NativeHIRC 当前只关注的音频事件映射范围

参考

维护

感谢

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

league_tools-1.1.5.tar.gz (133.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

league_tools-1.1.5-py3-none-any.whl (96.6 kB view details)

Uploaded Python 3

File details

Details for the file league_tools-1.1.5.tar.gz.

File metadata

  • Download URL: league_tools-1.1.5.tar.gz
  • Upload date:
  • Size: 133.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for league_tools-1.1.5.tar.gz
Algorithm Hash digest
SHA256 6e23089369453658c159b9bd5d3a1c87f23836f8c8f7ea558359ec389cbd03d6
MD5 1aeed1217b86b4acf20e7bb3c5d4f224
BLAKE2b-256 e690ab76675eada0407d2104cab82b778cc4d01e2af8f0e12169ea65f711509a

See more details on using hashes here.

Provenance

The following attestation bundles were made for league_tools-1.1.5.tar.gz:

Publisher: python-publish.yml on Virace/league-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file league_tools-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: league_tools-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 96.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for league_tools-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 cc6e2a0271cf2574c1afb3290d970d9f7c6c3f1de2a0a50ff4bfa779f6c1315e
MD5 0889e22fb43a3b9f869c0c4e01ff0891
BLAKE2b-256 1e02bb03c247ace29e82c85d84cc4029938ace589e9d09b5ccc07ade41ccebee

See more details on using hashes here.

Provenance

The following attestation bundles were made for league_tools-1.1.5-py3-none-any.whl:

Publisher: python-publish.yml on Virace/league-tools

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page