# 解包王国之泪提取音频资源

**URL:** <https://www.soundengine.cn/t/topic/46>\
**Category:** 游戏开发\
**Created:** [2023 年5 月 29 日 13:56 UTC](https://www.soundengine.cn/t/topic/46 "2023-05-29T13:56:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

作者： ![zaibuyidao](https://www.soundengine.cn/user_avatar/www.soundengine.cn/zaibuyidao/32/46_2.png) [@zaibuyidao](https://www.soundengine.cn/u/zaibuyidao)\
发布日期： [2023 年5 月 29 日 13:56 UTC](https://www.soundengine.cn/t/topic/46/1 "2023-05-29T13:56:38Z")

</div>

研究了一下游戏音频资源提取，顺利走完流程，在这里做下记录。  
经过梳理，使用以下方法提取效果非常好并且很容易，有兴趣的同学跟着步骤做就可拿到。目前只测试提取王国之泪，其他游戏未测试，理论上大部分游戏都可以提取。

 ![1685423062507-963fd841-26e6-472a-bd9d-d2a590eb6034-image.png](https://www.soundengine.cn/uploads/default/original/1X/381783519516ddc2564bb2db8d0e1428299f0ede.png)

## 所需文件：

1. hactool [https://github.com/SciresM/hactool/releases](https://github.com/SciresM/hactool/releases)
2. vgmstream [https://github.com/vgmstream/vgmstream/releases](https://github.com/vgmstream/vgmstream/releases)
3. 游戏本体 .nsp 或 .xci
4. 密钥 prod.keys（请勿贴出自己的密钥，这是违法的）
5. tf.exe 用于获取 titlekey
6. extract\_nxn.bat（自制解包器）
7. convert\_btw.bat（格式转换器）

**以上 1 2 3 4 需要自行解决，5 6 7 本贴底部有下载**

## 解包流程（只需简单5步）：

1. 把 hactool.exe 、prod.keys 、tf.exe、extract\_nxn.bat、convert\_btw.bat 和 vgmstream 文件夹放在同一目录下：

 ![1685391061409-e7585fd7-d409-49ec-8e36-461cce95532b-image.png](https://www.soundengine.cn/uploads/default/original/1X/b14c9ec24d9ae885ca120f4a44cb51b9e56808c0.png)

1. 使用 **extract\_nxn.bat** 提取游戏本体 .nsp 文件中的 nca 文件：

 ![1685368217131-d9500d15-4758-4e50-9672-79603a84c83f-image.png](https://www.soundengine.cn/uploads/default/original/1X/33abba4c87e83c2dbf4ef4a791e0617b4463c6ea.png)  
双击运行 extract\_nxn.bat，按照提示输入1，提取游戏本体 .nsp .xci 文件中的 .nca 文件，此步骤自动完成。

1. 继续下一步，按照提示输入2，提取游戏升级 .nsp 文件中的 .nca 文件：

 ![1685368522496-f1802ebf-0d4c-474e-83e6-8ce3d784a29d-image.png](https://www.soundengine.cn/uploads/default/original/1X/dc4a06b99120aa853e43e38fe7c9013829708e5e.png)  
如果没有游戏升级包，则不需要操作。

**这里 hactool 会提示：“[WARN] prod.keys does not exist.”，请无视之**

1. 使用 **extract\_nxn.bat** 按照提示输入3【最新2.0版本要输入7】，开始转储 RomFs

 ![1685379372504-658e2a73-6a4f-44ad-8c7f-ac1fff2b2680-image.png](https://www.soundengine.cn/uploads/default/original/1X/729ffdb782289ef6890cb149d0d0ddb5dadaf378.png)

 ![1685374785821-967cb423-cc92-49a7-a62b-12fa50de2c07-image.png](https://www.soundengine.cn/uploads/default/original/1X/8f4eb075779b69bf241ae74c4a2f6f15aa07d62a.png)

所有的资源内容将被提取到 romfs 文件夹。请注意，这就是解包后的所有文件。  
所有音效资源路径在这里： **X:\hactool\romfs\_nxn\Sound\Resource\Stream**  
还发现一个语音资源路径： **X:\hactool\romfs\_nxn\Voice\Resource**

 ![1685384830803-de482dfb-bd90-4b7d-825b-200a90f1eb84-image.png](https://www.soundengine.cn/uploads/default/original/1X/3f8242bb93d17efa83192de6b9bf5bea8cdde9ef.png)

**5. 最重要的步骤(也是最后一步)：**  
获取到音频资源后，你会发现所有音频文件并不是常用的音频格式，而是没见过的 BWAV 文件。

**科普：**  
BWAV（或BCWAV）是一种Nintendo专有的音频文件格式，主要用于Nintendo 3DS和Nintendo Switch的游戏。BWAV文件可以存储多个音频流，以支持多语言和立体声音频，其中可能包含ADPCM或PCM编码的音频。

本文中我使用了 vgmstream 进行格式转换。为此，我写了一个批处理脚本 convert\_btw.bat 以配合 vgmstream 工作，现在转换WAV变得非常简单，只需要两步，双击 **convert\_btw.bat** ：  
1、填写需要转WAV的文件夹路径（支持将文件夹拖拽到命令行）；  
2、确认执行转换（将会创建一个带“\_btw”命名的转换文件夹）

提示转换完成之后，在"音频文件夹\_btw"就会看到已转换好的大量WAV文件，大功告成！

提取的 Sound 和 Voice 音频资源总计：  
34,577 个文件，962 个文件夹  
23.0 GB (24,772,050,944 字节)

**extract\_nxn.bat 版本更新:**  
[extract\_nxn-v2.3.bat.zip](https://www.soundengine.cn/uploads/short-url/brZ1xOOq2GkLuCm5M5D30tsmAbR.zip) (2.98 KB) – 修复 游戏主体解密错误  
[extract\_nxn-v2.2.bat.zip](https://www.soundengine.cn/uploads/short-url/t1ICyL8J5jCXYYgxzYQHcHZRkBL.zip) (2.91 KB) – 新增 主体无titlekey时自动解包  
[extract\_nxn-v2.1.bat.zip](https://www.soundengine.cn/uploads/short-url/h0hPvwSDC7f6xUECeB3BsfJCOFo.zip) (2.88 KB) – 优化 功能调优  
[extract\_nxn-v2.0.bat.zip](https://www.soundengine.cn/uploads/short-url/n7OD5Uuc8dWhTLIh1IvSDSC2rLc.zip) (2.87 KB) – 优化 XCI自动化提取，升级包提取+自动解密本体，新增检测titlekey功能  
[extract\_nxn-v1.9.bat.zip](https://www.soundengine.cn/uploads/short-url/hIJfUbNAieWidTyZVkLVX0eugJ2.zip) (2.67 KB) – 新增 XCI支持，游戏升级包提取优化  
[extract\_nxn-v1.8.bat.zip](https://www.soundengine.cn/uploads/short-url/dYr4PzkGMHhjA8iWvXmH77kKv7J.zip) (2.08 KB) – 优化 同时提取本体+升级NCA  
[extract\_nxn-v1.7.bat.zip](https://www.soundengine.cn/uploads/short-url/fCHJ2kJvc7C1Ozaa6r2ylasdOdI.zip) (1.89 KB) – 新增 只提取游戏本体或升级包  
[extract\_nxn-v1.6.bat.zip](https://www.soundengine.cn/uploads/short-url/roysFNeJJztinQlrVAh9NPrBfA0.zip) (1.76 KB) – 修复 引号路径问题  
[extract\_nxn-v1.5.bat.zip](https://www.soundengine.cn/uploads/short-url/1pwczStGhJzYh6RYGz8RofzFpY4.zip) (1.68 KB) – 新增 提取DLC  
[extract\_nxn-v1.4.bat.zip](https://www.soundengine.cn/uploads/short-url/srQTR7yWUqTOSupIVY6STfAk6sp.zip) (1.49 KB) – 优化 根据titlekey的存在与否，决定NCA模块自动填写  
[extract\_nxn-v1.3.bat.zip](https://www.soundengine.cn/uploads/short-url/1wjV20qqPgdKTPHMfx7Gmx4docb.zip) (1.45 KB) – 新增 支持自动获取游戏本体文件名，自动填写  
[extract\_nxn-v1.2.bat.zip](https://www.soundengine.cn/uploads/short-url/3D2VgZ9nofGIG7icz7DR9HOV8kz.zip) (1.27 KB) – 新增 支持自动获取titlekey，自动填写  
[extract\_nxn-v1.1.bat.zip](https://www.soundengine.cn/uploads/short-url/rMDl2ROEAH8WGtb2E6mOczZ0Fz.zip) (999 Bytes)  
[extract\_nxn-v1.0.bat.zip](https://www.soundengine.cn/uploads/short-url/8em8U7IOOWaR66BpjFWSvGEiHMM.zip) (988 Bytes)

**convert\_btw.bat 版本更新:**  
[convert\_btw-v1.8.bat.zip](https://www.soundengine.cn/uploads/short-url/ZbRsgeQWXfVeSVBMO4SKxpF4HX.zip) (963 Bytes) – 新增 .wem 支持  
[convert\_btw-v1.7.bat.zip](https://www.soundengine.cn/uploads/short-url/rDkHOX57NPpAGsNpTGABZ182Zs9.zip) (957 Bytes) – 优化 代码文本内容  
[convert\_btw-v1.6.bat.zip](https://www.soundengine.cn/uploads/short-url/tD5vyYjaR3lJrMcottCvWBxbJtx.zip) (962 Bytes) – 新增 支持 \*.bfwav 格式转 .wav  
[convert\_btw-v1.5.bat.zip](https://www.soundengine.cn/uploads/short-url/YWKKPLYsypHNq2xt9L9qH2IKiU.zip) (956 Bytes) – 新增 支持 \*.bwav, \*.bfstm 格式转 .wav  
[convert\_btw-v1.4.bat.zip](https://www.soundengine.cn/uploads/short-url/vVH0zVTMT6aBKJtiwq2VcHg3sxK.zip) (936 Bytes) – 修复 引号路径问题  
[convert\_btw-v1.3.bat.zip](https://www.soundengine.cn/uploads/short-url/yBSECllAgPHrnEUnaq3KPFl6gvJ.zip) (925 Bytes) – 新增 支持在指定文件夹创建同级转换文件夹\_btw  
[convert\_btw-v1.2.bat.zip](https://www.soundengine.cn/uploads/short-url/79fx8377hrBVVlPeDWeyLd8Veea.zip) (787 Bytes)

**bars-to-bfwav.bat 版本更新:（使用该脚本需要安装 [Python](https://www.python.org/downloads/) ）**  
[bars-to-bfwav-v1.0.zip](https://www.soundengine.cn/uploads/short-url/cenJvsXymco2F6V2UydN5FLIxgo.zip) (2.93 KB) 转换 .bars 为 bfwav（再用 convert\_btw.bat 继续转 wav）

**bars-to-bwav.bat 版本更新:（使用该脚本需要安装 [Python](https://www.python.org/downloads/) ）**  
[bars-to-bwav-v1.0.zip](https://www.soundengine.cn/uploads/short-url/ynYr4fxrtKOME5RTUQtaOzkvwaB.zip) (1.92 KB) 转换 .bars 为 bwav（再用 convert\_btw.bat 继续转 wav）

**bfsar\_split.bat 版本更新:**  
[bfsar\_split-v1.1.zip](https://www.soundengine.cn/uploads/short-url/c2XzC96OAnaAEQlAp0mZUKiSu37.zip) (3.54 KB) – 新增 .bfgrp 格式支持  
[bfsar\_split-v1.0.zip](https://www.soundengine.cn/uploads/short-url/rYbCW9qvqWLOA24derk4zIaD1xw.zip) (3.54 KB) – 转换 .bfsar 为 bfwav/bfstp/bfseq（再用 convert\_btw.bat 继续转 wav）

**tf.exe**  
[tf.zip](https://www.soundengine.cn/uploads/short-url/A3uouBR3zlvlj3FkUoVyMtx9WTt.zip) (1.82 KB)

aras-to-bfsar.bat - 将 aras 文件转为 bfsar  
[sarc\_tool\_aras-to-bfsar.7z](https://www.soundengine.cn/uploads/short-url/taeGaMOWTLtcW6gjbDYzLcMx3Pt.7z) (4.6 MB)

文件前缀管理器 – 将文件移动到对应前缀的文件夹  
[file\_prefix\_folder\_manager.zip](https://www.soundengine.cn/uploads/short-url/rLuESKBMGohKxgbfZRiwJ0SRwfj.zip) (521 Bytes)

批量删除空文件夹  
[delete\_empty\_folders.zip](https://www.soundengine.cn/uploads/short-url/azR5d8dnIi6Gl8nS09udknUGxJT.zip) (635 Bytes)

批量移除指定文件夹文件名中的字符内容  
[remove\_subfolder\_string.zip](https://www.soundengine.cn/uploads/short-url/pGzLtVNgmfistArjLO8Ra1g1jOk.zip) (662 Bytes)

ZS解压工具  
[zsdt-v1.0.zip](https://www.soundengine.cn/uploads/short-url/mL2zKZreS3zJxSqGG5WczrSWp4V.zip) (1.63 MB)

**其他：**

Wwise Unpacker 解包 bnk 为 OGG 格式  
[https://github.com/Vextil/Wwise-Unpacker](https://github.com/Vextil/Wwise-Unpacker)  
[unpack-to-wav.zip](https://www.soundengine.cn/uploads/short-url/8jMDoq3vvHkqz4UqZGbhyGbXgGk.zip) (368 Bytes) – 追加这个脚本可以新增 转为 wem 格式（再用 convert\_btw.bat 继续转 wav）

VGMTrans\_WTL.exe – brsar 解包工具（天空之剑）  
[https://github.com/magcius/vgmtrans/releases](https://github.com/magcius/vgmtrans/releases)

nus3audio\_extractor.py – 将 nus3audio 转为 wav，需要配合 vgmstream 使用 (任天堂明星大乱斗特别版)  
[nus3audio\_extractor-v1.3.py.zip](https://www.soundengine.cn/uploads/short-url/hJoiu4AUgT7DU2Bvxg4Gfakbaj8.zip) (1.6 KB)

PKZ 提取器 – (Bayonetta 3)  
[pkz\_extract.zip](https://www.soundengine.cn/uploads/short-url/8JrQPnaMx974ifyLk5CmRDt3yqF.zip) (112 KB)

---

<div class="post-metadata">

作者： ![user19](https://www.soundengine.cn/letter_avatar_proxy/v4/letter/u/3be4f8/32.png) [@user19](https://www.soundengine.cn/u/user19)\
发布日期： [2023 年6 月 8 日 02:59 UTC](https://www.soundengine.cn/t/topic/46/2 "2023-06-08T02:59:53Z")

</div>

感谢刀哥，这个超实用的

---

<div class="post-metadata">

作者： ![sangee](https://www.soundengine.cn/letter_avatar_proxy/v4/letter/s/ac8455/32.png) [@sangee](https://www.soundengine.cn/u/sangee)\
发布日期： [2026 年7 月 27 日 08:18 UTC](https://www.soundengine.cn/t/topic/46/3 "2026-07-27T08:18:17Z")

</div>

简单明了，这个才是我想法要的，其他很多都太零散了
