Thanks to MeguminSama's project which has been a huge source of inspiration for this.
- The project
- How to extract musics
- Requirements and installation
- How to use it
- About update packages
- Contributing
- Feedbacks
- External executables
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
- Download and install Java 17 or newer from the official website.
- Download the extractor from the release page.
- Extract the zip file downloaded anywhere on your computer. The directory does not matter.
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:
- Open the directory where the
hoyoverse-music-unpacker.jar
file and thewrappers
directory are. - Hold the
Shift
key and right-click on an empty space in the directory. - Select the
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.
- Unpack PCK files to workspace (PCK -> WEM)
- Unzip update zip package to workspace
- Patch PCK files using update package (skipped for Honkai Impact which is not using HDIFF files)
- Unpack patched PCK files (PCK -> WEM)
- Convert WEM to WAV
- Index files from step 2 and 6
- Compare files and rename if --prefix
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:
- [-]: The file did not change compared to the current version
- [C]: The file has been created with this update.
- [U]: The file has been updated with this update.
- The file being updated might mean two things: Either it is an old song that has been updated/renamed, or it's a new song using an old filename.
- [D]: The file has never been seen, but is very similar to an already existing one within the game.
- This happens way more often than you think...
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.
- QuickBMS: Used to unpack PCK files to WEM files
- VGMStream: Used to convert WEM files to WAV files
- hdiffpatch: Used to patch PCK files with the
hdiff
files in the update package