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 f32s, 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 file
  • B is the sample rate in samples per second
  • [C, D,...] are tags, each associated with one stream

Modules§

Structs§

Enums§

  • A nice little error that we can return if things go wrong throughout the process of reading, building, or writing a GrapeFile.
  • The GrapeTag identifies the kind of spatial data contained within a particular stream.