Adding and Editing Sounds


Heroes II stores its sounds as a raw WAV file, a WAV file without headers. 

 

See Packaging Resources to learn how to extract the sound files from the original game. You can open and edit the .82M sound files using any sound editor capable of importing raw WAV data. We recommend Audacity, http://audacity.sourceforge.net/about/ . Use the "Import Raw Data" menu option and set it to import as 8-bit mono with a sampling rate of 22050.

 

 

You can make sounds using any sound editor and then export them in the same format. If you are using Audacity, enter its preferences, and, under "Quality," set Sample Rate to 22050. Run "Export Audio," set the file format to "Other Uncompressed," set the header to RAW / no header, and set the format to 8-bit unsigned PCM. 

 

Alternatively, if you save as an 8-bit WAV with a header, you will need to strip the 44-byte header. Run the following command on a Mac or Unix-based system:

 

dd bs=44 skip=1 if=sound.wav of=sound.82M

 

If you import a WAV file that does have a header, it will still work, but there will be a brief clicking noise at the beginning.

 

 

While all of the original games sounds are .82M files, the game also supports a couple different formats. The "8", "2", and "M" are actually codes that tell the game how to read the file, similar to the WAV headers which it omits.

8 - sample type. Available types: 8 - 8-bit unsigned, 6 - 16-bit unsigned

2 - sample rate. Available rates: 4 - 44100 Hz, 2 - 22050 Hz, 1 - 11025 Hz

M - defines that the sound is mono. Removing it will make the game read it as stereo

Example: CPLCATTK.64 - The sound of Cyber Plasma Lancer attacking in 16-bit unsigned 44100 Hz stereo format

 

P.S. Audacity cannot export as 16-bit unsigned uncompressed PCM. For that purpose ironfist uses ffmpeg

ffmpeg -i "%input_file%" -f u16le -c:a pcm_u16le -ar 44100 -ac 2 "%output_file%"