WAD、BIN、BNK、WPK文件简单处理
Project description
league-tools
WAD、BIN、BNK、WPK文件简单处理
介绍
可以将英雄联盟中wpk或bnk中音频文件按照皮肤的触发条件分类解包, 默认为wem音频格式, 使用 vgmstream 可转码.
- index.py中 extract_audio 函数逻辑以及HIRC部分块结构和WPK文件结构参考Morilli编写的解包工具https://github.com/Morilli/bnk-extract
- WAD.py中 文件结构以及部分逻辑来源于https://github.com/CommunityDragon/CDTB 和 https://github.com/Pupix/lol-file-parser
其余bnk文件结构来参考:http://wiki.xentax.com/index.php/Wwise_SoundBank_(*.bnk)
安装
pip install league-tools
pip install -e git+https://github.com/Virace/py-bnk-extract@package#egg=league_tools
使用
此包适合提取已知皮肤语音, 如需全部提取请关注 lol_extract_voice
from league_tools import extract_audio
from league_tools.formats import WAD
def example():
"""
按触发事件文件夹分类提取 剑魔 语音文件
:return:
"""
# 临时目录和最终输出目录
temp_path = r'D:\Temp'
out_path = r'D:\Out'
# 英雄名字, 以及对于默认皮肤的三个文件路径
champion = 'aatrox'
bin_tpl = f'data/characters/{champion}/skins/skin0.bin'
audio_tpl = f'assets/sounds/wwise2016/vo/zh_cn/characters/aatrox/skins/base/{champion}_base_vo_audio.wpk'
event_tpl = f'assets/sounds/wwise2016/vo/zh_cn/characters/aatrox/skins/base/{champion}_base_vo_events.bnk'
# 需要解析两个WAD文件, 这个路径修改为自己的游戏目录
wad_file1 = r"D:\League of Legends\Game\DATA\FINAL\Champions\Aatrox.wad.client"
wad_file2 = r"D:\League of Legends\Game\DATA\FINAL\Champions\Aatrox.zh_CN.wad.client"
# 将上面三个文件提取到临时目录
WAD(wad_file1).extract([bin_tpl], temp_path)
WAD(wad_file2).extract([audio_tpl, event_tpl], temp_path)
# 根据三个文件对应提取语音并整理
extract_audio(
bin_file=os.path.join(temp_path, os.path.normpath(bin_tpl)),
event_file=os.path.join(temp_path, os.path.normpath(event_tpl)),
audio_file=os.path.join(temp_path, os.path.normpath(audio_tpl)),
out_dir=out_path
)
if __name__ == '__main__':
example()
问题
待解决:
不同事件调用相同语音, 导致文件重复- 不排除文件有缺失问题, event文件解析不完整
维护者
Virace
- blog: 孤独的未知数
感谢
-
@Morilli, bnk-extract
-
@Pupix, lol-file-parser
-
@CommunityDragon, CDTB
-
@vgmstream, vgmstream
-
以及JetBrains提供开发环境支持
许可证
Project details
Release history Release notifications | RSS feed
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-0.2.3.tar.gz
(45.5 kB
view details)
Built Distribution
File details
Details for the file league_tools-0.2.3.tar.gz
.
File metadata
- Download URL: league_tools-0.2.3.tar.gz
- Upload date:
- Size: 45.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70ea564aa7e2f257933eebe6bc56e2cdf56082cac8231b468c96711a52f3e9ff |
|
MD5 | a3c3e89fe692700b0994dd364de8536a |
|
BLAKE2b-256 | fb09fbdfe52673e7fe9e2d139b96e1b0f7597293713a30cf1518af120f8095e8 |
File details
Details for the file league_tools-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: league_tools-0.2.3-py3-none-any.whl
- Upload date:
- Size: 51.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0681a2b72f95c60ec6ca69b481dae92dc2a77fa8c054b91a466905d02e3f051f |
|
MD5 | 08a6e588e209e8a4d1e84a903c024ed8 |
|
BLAKE2b-256 | ae8b1ce64a8db66f1715d5f19e39ac74421bea429f71025190035180ca48ee19 |