Data Definition
The output data structure of the AO module consists of the extra stream packet information (extData), packet size, and actual data. The data is specified by the RETURN_AUDIO_DATA command word in the VmiCmdAudio enumeration and returned to developers through callbacks.
Example:
VmiDataType module = AUDIO; VmiCmd cmd = RETURN_AUDIO_PLAY_DATA; AudioData audioData; uint8_t* data = &audioData; DataCallback(module, cmd, data, sizeof(AudioData));
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: Audio Output Development