HikoGUI
A low latency retained GUI
|
#include <hikogui/audio/audio_block.hpp>
Data Fields | |
float ** | samples |
A list of pointers to non-interleaved sample buffers. | |
std::size_t | num_samples |
Number of samples for each channel in samples. | |
std::size_t | num_channels |
Number of channels in samples. | |
int | sample_rate |
The sample rate this block was taken at. | |
int64_t | sample_count |
The sample count value for the first sample in the sample buffers. | |
utc_nanoseconds | time_stamp |
Time point when the sample was at the input or will be at the output of the audio interface. | |
audio_block_state | state |
The state of the audio block. | |
A block of audio data.
This represents a block of audio data received from, or to be send to, an audio device.
The samples in this block are always in native floating point format for easy processing. The samples are stored continues for each channel so that processing can be done at a per-channel basis using SSE instructions.
std::size_t hi::v1::audio_block::num_channels |
Number of channels in samples.
std::size_t hi::v1::audio_block::num_samples |
Number of samples for each channel in samples.
int64_t hi::v1::audio_block::sample_count |
The sample count value for the first sample in the sample buffers.
int hi::v1::audio_block::sample_rate |
The sample rate this block was taken at.
This is the word-clock rate, not the sample rate the device was configured as.
float** hi::v1::audio_block::samples |
A list of pointers to non-interleaved sample buffers.
It is undefined behavour to modify the samples on input.
Each of the sample buffers is aligned to and a multiple of 4096 bytes in size which will allow you to over-read or over-write with vector instructions beyond the num_samples
of samples.
The sample buffers are NOT pre-cleared during recording.
audio_block_state hi::v1::audio_block::state |
The state of the audio block.
Examples of how corruption could happen:
When the state is corrupt; DO NOT READ THE SAMPLE_BUFFER.
utc_nanoseconds hi::v1::audio_block::time_stamp |
Time point when the sample was at the input or will be at the output of the audio interface.