1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-10-05 23:56:33 +00:00
0 File Format: Enterprise ep128emu TAP
Thomas Harte edited this page 2021-07-12 12:01:13 -04:00

Ep128emu's TAP is a 1-to-8 bit sampling of an audio tape that usually has the file extension .tap.

There are two versions of the file format; the second adds a sequence of bookmarks into the sampled data.

Version 1

The first version of the file format has no header; it is simply a capture of the tape's audio level at 1-bit precision and a sampling rate of 24,000 Hz.

Detection

A parsing of the audio stream to look for Enterprise-format tape data is required.

Reconstruction

Output each bit of the file as an audio level for 1/24000ths of a second; in each byte output the MSB first and proceed downward.

Version 2

The second version adds a 4096-byte header, comprised of:

  1. the 8-byte signature 0x02, 0x75, 0xCD, 0x72, 0x1C, 0x44 0x51, 0x26;
  2. a four-byte number indicating the capture precision: 1-bit, 2-bit, 4-bit or 8-bit;
  3. a four-byte number indicating the capture frequency; and
  4. up to 1020 bookmarks — each is a 4-byte quantity indicating an offsets in samples. Bookmarks have no additional metadata associated with them. Unused slots are filled with 0xffffffff.

Detection

The 8-byte signature plus the limited number of possibilities in the capture precision that effectively provide at least another three bytes of signature can be used to detect an ep128emu tape file.

Reconstruction

Starting at file position 4096, output each group of 1, 2, 4 or 8 bits as an audio level, taking bits from each byte MSB first and reconstructing multibit quantities MSB first. Output each level for the amount of time implied by the sampling frequency.