Card sounds - Zero-to-Heroes/firestone GitHub Wiki

Overview

Extracting the sound files

If you want to extract the sound files yourself from the game assets, I highly recommend using the excellent open-source UnityPack. You can extract all the sound files by running that command from the UnityPack root folder (where /d/... is your hearthstone install folder):

./bin/unityextract --audio -o out/audio /d/Games/Hearthstone/Data/**/*.unity3d

Building the cardId / sound file mapping

I have built a script that produces a json file with the mapping. You can get it from this HearthstoneJSON fork (HearthstoneJSON is now closed source, so my own script has been clunckily hacked to still work with the latest versions of Hearthstone). You can use the following command to build the mapping:

./generate_audio.py /d/Games/Hearthstone/Data/**/*.unity3d

The output is a mapping file like this: https://raw.githubusercontent.com/Zero-to-Heroes/hs-reference-data-parser/master/src/main/resources/hearthstoneparser/sound_effects.json

Once you have the sound files and the mapping, you can do whatever you want :)

Notes

  • Not all sounds are mapped. I'm currently focusing on the sounds for collectible cards, so things like hero voice lines are missing
  • When you have several sounds for a single step (for instance, a sound and a music for the Play step), they are meant to be played together
  • Spell sounds are a random collection of sound effects. The game engine chains these effects together when you actually play the spell, but this is out of my depth to recreate for now.
  • Don't hesitate to propose improvements to the scripts via pull requests :)