I am developing an Audio Source plugin for OBS. I unfortunately can find very little documentation for doing this.
I think I'm pretty close to getting it working, but I am still trying to pin down what the values in the 'obs_source_audio' structure should be.
This is my current guess...
I would be very grateful if someone could confirm correct values for these structure members.
I think I'm pretty close to getting it working, but I am still trying to pin down what the values in the 'obs_source_audio' structure should be.
This is my current guess...
Code:
struct obs_source_audio // from "obs.h" header file with my comments (guesses)
{
const uint8_t *data[MAX_AV_PLANES];
// an array containing the pointers to 1 or more data blocks with audio data
// My guess is that...
// - for "interleaved" PCM data, only the 1st pointer in the array should be used
// - for
uint32_t frames; // I am currently NOT SURE what this is supposed to contain???
enum speaker_layout speakers;
// Number if input audio channels.
// Example:
// 1 channel audio = SPEAKERS_MONO,
// 2 channel audio = SPEAKERS_STEREO,
enum audio_format format;
// Input audio format.
// Examples:
// Interleaved 16 bit audio = AUDIO_FORMAT_16BIT,
// Non-interleaved (planar) floating point audio = AUDIO_FORMAT_FLOAT_PLANAR
uint32_t samples_per_sec; // Number of audio samples to be played in 1 second
uint64_t timestamp; // I am not sure if this timestamp should start with zero, or with the current clock time???
};
I would be very grateful if someone could confirm correct values for these structure members.