00:00
00:00
View Profile Averon25
Dmitri Leontev @Averon25

Age 23, Male

Chita, Russia

Joined on 12/16/11

Level:
11
Exp Points:
1,220 / 1,350
Exp Rank:
53,472
Vote Power:
5.31 votes
Rank:
Civilian
Global Rank:
> 100,000
Blams:
0
Saves:
4
B/P Bonus:
0%
Whistle:
Normal
Medals:
713

Averon25's News

Posted by Averon25 - April 23rd, 2023


I began remaking Oska Software's DeskMates in Python on March 28 of this year. Contributions are welcome.

https://github.com/DimaLeon2000/PyDeskMates


Tags:

Posted by Averon25 - March 31st, 2023


WAS & WA3 are file formats used by @Oska's DeskMates, which is programmed in Visual C++, for storing sounds. A WAS/WA3 file consists of a header, a directory, and data lumps that make up the sounds stored within the file, in that exact order. The formats are similar to the WAD format (used by Doom and all Doom-engine-based games), except the file signature is missing and the directory is placed before data instead of at the end of the file. The difference between WAS and WA3 is that the former stores uncompressed 16-bit 8kHz (these parameters are hard-coded into DeskMates) LPCM (linear pulse-code modulation) audio data while the latter stores MP3 encoded data. The values are labelled by myself.


Header

A WAS/WA3 file always starts with a 8-byte header. It contains two values:

  • dataLength (length: 4) - An integer representing the size of the WAS/WA3 file in bytes.
  • soundCount (length: 4) - An integer specifying the number of sound effects in the WAS/WA3.


All integers are 4 bytes long in x86-style little-endian order. Their values can never exceed 2³¹-1, since DeskMates reads them as signed ints.


Directory

The directory associates names of sounds with the data that belong to them. It consists of a number of entries, each with a length of 8 bytes. The length of the directory is determined by the number given in the WAS/WA3 header. The structure of each entry is as follows:

  • nameOffset (length: 4) - An integer holding a pointer to the start of the sound’s name in the file, relative to the beginning of lumps.
  • dataOffset (length: 4) - An integer holding a pointer to the start of the sound's data in the file, relative to the beginning of lumps.


Data lumps

This is the meat of the file format. It consists of a number of sounds, each with a corresponding name and a data lump (which is the same as the "data" sub-chunk in the WAVE file format minus the ID). The structure of each entry is as follows:

  • name (length: variable, presumable max length: 64) - A variable ASCII string defining the sound's name. The name must be nul-terminated if less than 64 characters.
  • wave-data:
  • ↳ length (length: 4) - An integer representing the number of bytes in the data.
  • ↳ data (length: uses the value of the "length" variable) - The actual sound data. Raw PCM in WAS, or MP3-encoded in WA3.

Tags: