Mystic Towers PC Speaker Sound Format
Jump to navigation
Jump to search
Mystic Towers PC Speaker Sound Format
Format type | Sound |
---|---|
Hardware | PC Speaker |
Number of sounds | 0-65535 |
Sampling rate | 50 Hz |
Channel count | 1 |
Bits per sample | 16 |
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!)