Example UEF file

From BeebWiki
Revision as of 23:16, 25 December 2011 by Jgharston (talk) (Minor formatting tweeks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here is a dissection of a simple UEF file representing a short audio capture of one file on cassette. Normal UEF files are compressed but this one is not, to show the contents. Emulators and standard libraries accept compressed or uncompressed UEF files.

First is a header identifying this as a UEF file.

55 45 46 20 46 69 6C 65  21 00                   | UEF File!.

Then the UEF file version number (0.10). This determines how several of the chunks are interpreted.

0A 00                                            | ..

From this point on are the chunks, each with a six byte header giving its meaning and its length.

The phase of this recording is 270 degrees. On this particular tape deck, amplifier and sound card, the frequency was found to change at points of most negative voltage. (Mnemonic: sin 270° = -1.)

15 01 02 00 00 00                                | ......
0E 01                                            | ..

The first audio element is a gap of about 1.33 seconds. This is the time that happened to pass between the start of capture and the start of the signal. The number is stored in IEEE floating point format; there is portable C code in the UEF specification to handle floating point values.

16 01 04 00 00 00                                | ......      
86 C9 A9 3F                                      | .ÉC?

Then, a 2400 Hz leader tone with a dummy byte. There are four cycles, then an &AA byte (whose value is constant and not recorded), then 12218 more cycles (5.09 seconds.) Other recordings have similar cycle counts.

The train of Long and Short cycles looks like: SSSS LLSSLSSLSSLSSSS (S × 12218) (Spaces for clarity only.)

(The dummy byte and following data are at 1200 baud, as no &0117 chunk has changed the default baud rate.)

11 01 04 00 00 00                                | ......
04 00 BA 2F                                      | ..º/

Now a data block in Acorn cassette format. The bytes are formatted 8N1, and the pulse train starts with: LLSSLSSLSSLLSS LSSSSLLSSLSSLSS LLLSSSSLLSSLSS ... (again, run together without spaces.)

In this case the first 26 bytes following the UEF header make up the Acorn header and the next 109 are the data.

00 01 89 00 00 00



 | ......
2A 53 4C 4F 41 44 00 00  19 FF FF 00 19 FF FF 00 | *SLOAD...ÿÿ..ÿÿ.
00 6D 00 80 00 00 00 00  FA 14 A9 84 20 F4 FF 86 | .m......ú.©. ôÿ.
80 84 81 A0 00 A9 01 A2  82 20 DA FF A6 82 A4 83 | ... .©.¢. Úÿ¦.¤.
A9 40 20 CE FF AA 20 4D  19 85 82 20 4D 19 48 29 | ©@ Îÿª M... M.H)
7F 85 83 68 30 13 20 4D  19 20 55 19 D0 F8 A5 81 | ...h0. M. U.Ðø¥.
10 E4 8A A8 A9 00 4C CE  FF 20 4D 19 85 84 A5 84 | .ä.¨©.LÎÿ M...¥.
20 55 19 D0 F9 F0 E7 8A  A8 20 D7 FF A0 00 60 91 |  U.Ðùðç.¨ ×ÿ .`.
80 E6 80 D0 04 E6 81 30  F3 A5 82 38 E9 01 85 82 | .æ.Ð.æ.0ó¥.8é...
B0 02 C6 83 05 83 60 52  74                      | °.Æ...`Rt

A trailer of 12736 cycles at 2400 Hz (5.31 seconds). This too varies in length between recordings.

10 01 02 00 00 00                                | ......
C0 31                                            | A1

Then a gap of approx. 1.77 seconds until the signal capture ends.

16 01 04 00 00 00                                | ......
69 F4 E2 3F                                      | iôâ?

Finally a string informally identifying the creator of the UEF file.

00 00 2F 00 00 00
41 63 6D 65 20 55 45 46  20 47 65 6E 65 72 61 74 | Acme UEF Generat
6F 72 20 31 2E 33 33 20  5B 4A 2E 42 6C 6F 67 67 | or 1.33 [J.Blogg
73 2C 20 32 30 30 34 2D  31 32 2D 30 35 5D 00    | s, 2004-12-05].

Here is the complete file: sload.uef

And here is what it sounds like. Be sure to turn your speakers right down: sload.au (zipped)

Reference

UEF file format specification (0.10, draft 28)

-- beardo 19:26, 10 July 2007 (BST)