Thanks to MeguminSama's project which has been a huge source of inspiration for this.
This project was made to extract music file from Genshin Impact, but later updated to support other Hoyoverse's title.
This program will only process PCK files that are known to contains mainly music, as extracting everything would also include voice lines and SFX. Maybe I'll add an option later to allow to extract everything, but please note that it will generate a lot of files (meaning a lot of disk space and time would be required).
Game | Music Extraction | Update Package Support |
---|---|---|
Genshin Impact | ✅ Supported | ❓ Unsure |
Honkai Star Rail | ✅ Supported | ❓ Unsure |
Honkai Impact | Partial Support | ❓ Unsure |
More about update package support here
You'll need to use the terminal to use the extractor. If you're not familiar on how to open the terminal in the directory you are in:
hoyoverse-music-unpacker.jar
file and the wrappers
directory are.Shift
key and right-click on an empty space in the directory.Open PowerShell window here
(label might vary slightly depending on your Windows version) -d, --diff Extract update package only
-g, --game=<gameFolder> Installation folder of the game
-h, --help Show this help message and exit.
-o, --output=<outputFolder>
Output folder for the extracted files
-p, --prefix (With --diff) Add status prefix to files
-t, --threads=<threadCount>
Number of parallel thread that can be used.
-V, --version Print version information and exit.
Important: Please note that --game
option must be the path leading to the launcher, not directly the game. Here is
a table to better explain what I mean (using my own install path, but you'll get the idea):
Game | Right Path (launcher) | Wrong path (game) |
---|---|---|
Genshin Impact | D:\Games\Genshin Impact | D:\Games\Genshin Impact\Genshin Impact game |
Honkai Star Rail | D:\Games\Star Rail | D:\Games\Star Rail\Games |
Honkai Impact | D:\Games\Honkai Impact 3rd glb | D:\Games\Honkai Impact 3rd glb\Games |
java -jar hoyoverse-music-unpacker.jar --game="D:\Games\Genshin Impact"
You have to replace the path of --game
by your own. "
around the game path are important !
Once finished, all musics will be present in the extracted
folder.
You can also change the output directory by using the --output
option. Example:
java -jar hoyoverse-music-unpacker.jar --game="D:\Games\Genshin Impact" --output="D:\Documents\Musics"
This will extract all music in D:\Documents\Musics
(a subdirectory will be created for each game).
[!IMPORTANT] Since Hoyoverse started changing the way the pre-download package work, you might not be able to use this. The reason being that they're not releasing it for everyone at the same time. Using the program in diff mode will not work and warn you that it could not find any update package.
I'm working on a way to make it compatible, but it might take some time. If you have an idea about it, do not hesitate to open a discussion.
When a game is going to be updated in the next few days, Hoyoverse allows player to download the update package before the actual release. This package contains the whole update and can be used to retrieve the music before the game is updated.
This is working by doing the same job as the launcher when applying the update. This won't be done on your game files ! When patching, it does not modify the original file, but creates a new one, avoiding breaking your game.
If you want to extract music from the update package (once the download through the launcher is finished), you have to
use the --diff
flag:
java -jar hoyoverse-music-unpacker.jar --game="D:\Games\Genshin Impact" --diff
This will leave a lot of file, both created and updated... If you want to know which one has been
created/updated, add the --prefix
flag:
java -jar hoyoverse-music-unpacker.jar --game="D:\Games\Genshin Impact" --diff --prefix
Every file will now have a prefix:
I'm open for contribution, but if your contribution is a new feature instead of a bugfix, it may be wise to open a discussion here before to avoid any potential waste of time.
For feature requests and question, please open a discussion here, for bug report please open an issue.
hdiff
files in the update package