libobs: Implement audio monitoring
Adds functions to turn on audio monitoring to allow the user to hear playback of an audio source over the user's speaker. It can be set to turn off monitoring and only output to stream, or it can be set to output only to monitoring, or it can be set to both. On windows, audio monitoring uses WASAPI. Windows also is capable of syncing the audio to the video according to when the video frame itself was played. On mac, it uses AudioQueue. On linux, it's not currently implemented and won't do anything (to be implemented).
This commit is contained in:
20
libobs/obs.h
20
libobs/obs.h
@@ -582,6 +582,15 @@ EXPORT enum obs_obj_type obs_obj_get_type(void *obj);
|
||||
EXPORT const char *obs_obj_get_id(void *obj);
|
||||
EXPORT bool obs_obj_invalid(void *obj);
|
||||
|
||||
typedef bool (*obs_enum_audio_device_cb)(void *data, const char *name,
|
||||
const char *id);
|
||||
|
||||
EXPORT void obs_enum_audio_monitoring_devices(obs_enum_audio_device_cb cb,
|
||||
void *data);
|
||||
|
||||
EXPORT bool obs_set_audio_monitoring_device(const char *name, const char *id);
|
||||
EXPORT void obs_get_audio_monitoring_device(const char **name, const char **id);
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* View context */
|
||||
@@ -914,6 +923,17 @@ EXPORT void obs_source_set_deinterlace_field_order(obs_source_t *source,
|
||||
EXPORT enum obs_deinterlace_field_order obs_source_get_deinterlace_field_order(
|
||||
const obs_source_t *source);
|
||||
|
||||
enum obs_monitoring_type {
|
||||
OBS_MONITORING_TYPE_NONE,
|
||||
OBS_MONITORING_TYPE_MONITOR_ONLY,
|
||||
OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT
|
||||
};
|
||||
|
||||
EXPORT void obs_source_set_monitoring_type(obs_source_t *source,
|
||||
enum obs_monitoring_type type);
|
||||
EXPORT enum obs_monitoring_type obs_source_get_monitoring_type(
|
||||
const obs_source_t *source);
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Functions used by sources */
|
||||
|
||||
|
Reference in New Issue
Block a user