This page describes the exact format used by the SPARC Audio File object when passing data to another object. The SPARC Audio Play object expects data to be in this form in so much that each of the buffer chunks described below should exist in the scatterbuffer passed. The order of the buffer chunks is irrelevant.
The SPARC Audio File object sends each frame (some variable number of samples) in a separate scatter buffer. A scatter buffer list corresponds to sending 1 or more frame. Each scatter buffer has the following buffer chunks:
This buffer chunk consists of:
The buffer chunk type which is:
The length of this chunk which is always 32.
The data in this buffer chunk consists of:
The device field indicates the original device that recorded the frame. Legal values include:
The dataFormat field specifies the SPARC Audio data format code that is present in SPARC .au files. Legal values can be found in the man page for SPARC audio devices but the most common ones are:
The samplingRate field specifies how many samples per second the data was recorded at.
The channelCount field specifies hom many channels of audio data are present (i.e., 1 for mono, 2 for stereo).
The logStart_s field specifies the second's component of the logical start time.
The logStart_ns field specifies the nano-second's component of the logical start time. The logical start time can be constructed as logStart_s + (logStart_ns / ONE_BILLION).
The logEnd_s field specifies the second's component of the logical end time.
The logEnd_ns field specifies the nano-second's component of the logical end time. The logical end time can be constructed as logEnd_s + (logEnd_ns / ONE_BILLION).
The buffer chunk type which is:
The length of this chunk which is variable.
The data for this SPARC audio frame (i.e., the samples).