Resource Interface File Format.

The file format informally known as .wav and .avi. This is Microsoft's audio/video format, innovatively very similar in structure with Apple's AIFF format.

Technically, it's a rather simple format, one of the most basic binary file structures. It's based on chunks that have

  1. a 4-byte type identifier (known as a fourcc),
  2. 4-byte length field that tells how many bytes the data field has, and
  3. the data field itself.

The data fields can contain other RIFF chunks.

Here's an easy algorithm for ripping a .wav to raw data (assuming the file is PCM and the thing didn't add too much extra baggage to the file): Skip leading bytes until you find character sequence "data", read next four bytes and interpret as the size, then read that many bytes.