Mystic Towers PC Speaker Sound Format

From ModdingWiki
Jump to navigation Jump to search
Mystic Towers PC Speaker Sound Format
Format typeSound
HardwarePC Speaker
Number of sounds0-65535
Sampling rate50 Hz
Channel count1
Bits per sample16
Compressed?No
Tags?None
Games

Format

Files in this format begin with a generic bank header also found in other files used by Mystic Towers.

Data type Name Description
UINT16LE iNumEntries Number of chunks (sub-files) in this file
UINT32LE[iNumEntries] iOffsets Offset of each chunk (from the beginning of the file)

Each sound itself is just an array of 32 UINT16LE values, so each sound has a size of 64 bytes. Each value in the array is shifted two bits to the right to convert it into a sound frequency in Hertz that is to be generated by the PC speaker.

If the resulting frequency value is 10,000 Hz or higher, no sound will be played. Otherwise the frequency value is passed as an argument to Turbo-Pascal's Sound() procedure.

Credits

This file format was reverse engineered by K1n9_Duk3. If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)