Module cybergrape::spatial_data_format
source · Expand description
This module provides an API to read and write GrapeFiles, a file format developed to contain spatial data in the time domain. The files have the following structure:
- First there is a header that contains some metadata:
- The sample rate of the file (samples per second)
- The number of data streams
- An array of tags for the data streams, indicating a cartesian dimenson, a spherical dimension, or a angular dimension; see GrapeTag.
- Then there is a seperator, which is a byte of all 1s;
0xFF
. - Finally, the samples, which are
f32
s, interpolated from each stream in order.
More concretely, the header is encoded using serde and ron. In the file, it appears as follows:
(n_streams:A,sample_rate:B,tags:[C, D,...])
Where:
A
is the number of streams contained in the fileB
is the sample rate in samples per second[C, D,...]
are tags, each associated with one stream
Modules§
- tests 🔒
Structs§
- This struct contains the header and samples associated with a GrapeFile
- This builder contains the data required
- This struct contains the header data for a GrapeFile.