.frob (FroB) File Format 💖
1. Summary
The FroB format is a simple, binary event stream designed for mono frequency playback. It is a compact, special-purpose format intended for the frobplayer app to play music on a PC's motherboard beeper.
All FroB-compliant files should have an extension of ".frob", with a magic value of "FROB1337" in the file's header.
2. File Structure
A FroB file is composed of three parts, in order:
- Header
- Event Stream (N * 8 bytes): A stream of playback events.
- End-of-Stream (EoS) Marker (8 bytes): An event that signals an end to playback.
All multi-byte values are encoded in LE.
2.1. Header
A FroB file should have FROB1337 encoded with ASCII in 8 bytes.
This allows the player to validate the file and prevent attempts to play non-FroB files.
2.2. Events
An event is 8 bytes, split into 2 uint32 values.
The first 4 bytes are the delta time. This is the time to wait before executing the event in microseconds. The second 4 bytes is the frequency to play, in hertz.
If an event's Frequency is "0", the player will stop playing all tones.
2.3. End-of-Stream (EoS) Marker
This has the same structure as an Event (see 2.2, Events), with special values:
- Delta Time: Any value, but full compliance to the FroB specification requires
0. - Frequency: 0xFFFFFFFF
This signals a valid end to playback. A player should stop playback upon reading this event. This helps the player distinguish a complete file from one that's corrupted.