Data Definition
The MI data structure is the same as the AO data structure, that is, AudioData, which consists of the extra stream packet information (extData), packet size, and actual data.
Definition of AudioData
struct AudioData {
ExtDataAudio extData; // Extra information
uint32_t size; // Size
uint8_t data[0]; // Data
} __attribute__((packed));
Definition of ExtDataAudio
struct ExtDataAudio {
uint32_t audioType = OPUS; // Encoding type: OPUS/PCM
uint8_t channels = 2; // Number of audio channels. 1: MONO/2: STEREO (default)
uint8_t audioBitDepth = 16; // Sampling depth in bits: 8 or 16 (default)
uint32_t sampleRate = 48000; // Sampling rate in Hz: 44100 or 48000 (default)
uint32_t sampleInterval = 10; // Sampling interval in ms: 10 (default)
int64_t timestamp; // Audio data timestamp in ms (UTC time)
} __attribute__((packed));
Parent topic: Microphone Input Development