A 1-bit digitised version of the tape's audio stream is fed as an input to the CB1 pin of the Oric's VIA. The ROM configures the 6522 to raise an interrupt upon a low-to-high transition of CB1. It then measures the amount of time between those interrupts using the 6522's second timer.
The period between one low-to-high transition and the next forms a complete wave. The ROM officially uses three lengths of wave for data encoding — short, medium and long. Fast encoding uses short and medium waves, slow encoding uses short and long waves.
The archetypal lengths for the three waves are 416µs, 624µs and 833µs.
A zero is encoded as a medium wave. A one is encoded as a short wave.
A zero is encoded as four consecutive long waves. A one is encoded as eight consecutive short waves.
Each byte is encoded as 10 meaningful bits plus a suffix of three-or-more that gives the CPU time to prepare for the next byte.
Each byte begins with a 0 as a start bit.
The start bit is followed by the eight bits that form the byte, in least significant to most significant order.
The eight data bits are followed by an even parity bit.
The 10 meaningful bits are then followed by at least three 1s as stop bits.
As a zero takes 416µs and a one 624µs, a bit stream composed of an equal number of 1s and 0s will be encoded at an average of 512µs per bit, for a baud rate of just over 1953. At 13 bits per byte that's a little above 150 bytes/second — it would take slightly less than five and a half minutes to load a complete 48 kb of information with fast encoding.
As a zero takes 4 * 833 = 3332µs and a one 8 * 416 = 3328µs, a bit stream composed of an equal number of 1s and 0s will be encoded at an average of 3330µs per bit, for a baud rate close to 300. At 13 bits per byte that's around 23 bytes/second — it would take around 35 and a half minutes to load a complete 48 kb of information with slow encoding.
When loading fast data, the ROM compares a wave's length to a threshold of 512µs to mark it as either short or medium; allowing for other work involved, a wave needs to be at least 115µs to be recognised at all, and at least 529µs to be recognised as a medium wave. So if a playback device with guaranteed ideal pitch is used, the average bit length can be reduced to 322µs, a baud rate of around 3105, implying almost 239 bps and around three and a half minutes for a complete 48kb (source).
Files are encoded as:
The starting and ending addresses are inclusive so there will be (ending address) - (starting address) + 1 bytes in the file's body.