当前仓库已转移到https://github.com/Virace/league-tools
当前仓库已转移到https://github.com/Virace/league-tools
当前仓库已转移到https://github.com/Virace/league-tools
py-bnk-extract
英雄联盟语音解包工具, 由Python语言编写.
介绍
可以将英雄联盟中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 lol-voice
pip install -e git+https://github.com/Virace/py-bnk-extract@package#egg=lol_voice
使用
此包适合提取已知皮肤语音, 如需全部提取请关注 lol_extract_voice
from lol_voice import extract_audio
from lol_voice.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提供开发环境支持
许可证
Metadata
Release files for lol-voice 1.0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lol_voice-1.0.4.1.tar.gz | 30.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lol_voice-1.0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 80.0 kB
Release files / lol_voice-1.0.4.1.tar.gz
| Download URL | lol_voice-1.0.4.1.tar.gz |
|---|---|
| Size | 30.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88b4fb7b58e9fbf18a0fcb0cb371b3926954ad8816df45ea2198d189537dd537
|
|
BLAKE2b-256 checksum How to use checksums |
449e66926b95d2d702ca46f6859b9a31862c902db5946343c15aca830ae1d5fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.2 Windows/11
|
Release files / lol_voice-1.0.4.1-py3-none-any.whl
| Download URL | lol_voice-1.0.4.1-py3-none-any.whl |
|---|---|
| Size | 49.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
40686ce7104c1e88be29ebf0865182823e78c161669ff81ecabf6386cb93a929
|
|
BLAKE2b-256 checksum How to use checksums |
0024e2e7b976a3e56c72a33ec0cdc72e1ac589e0dc0a3c72fd78b336d7f75315
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.2 Windows/11
|
Security for lol-voice 1.0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.