mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-07-27 15:46:13 -04:00
UI: Add low latency audio buffering mode to UI
This feature is meant to reduce maximum audio buffering and turn off dynamic buffering mode. This allows the lowest possible consistent latency for audio buffering, which is useful for the decklink and NDI outputs which cannot rely on audio timestamps for synchronization. This can have a negative effect of making audio segments (partial or in full) cut out. So audio glitching or audio loss can occur if this is enabled.
This commit is contained in:
@@ -4409,7 +4409,7 @@ bool OBSBasic::ResetAudio()
|
||||
{
|
||||
ProfileScope("OBSBasic::ResetAudio");
|
||||
|
||||
struct obs_audio_info ai;
|
||||
struct obs_audio_info2 ai = {};
|
||||
ai.samples_per_sec =
|
||||
config_get_uint(basicConfig, "Audio", "SampleRate");
|
||||
|
||||
@@ -4431,7 +4431,14 @@ bool OBSBasic::ResetAudio()
|
||||
else
|
||||
ai.speakers = SPEAKERS_STEREO;
|
||||
|
||||
return obs_reset_audio(&ai);
|
||||
bool lowLatencyAudioBuffering = config_get_bool(
|
||||
GetGlobalConfig(), "Audio", "LowLatencyAudioBuffering");
|
||||
if (lowLatencyAudioBuffering) {
|
||||
ai.max_buffering_ms = 20;
|
||||
ai.fixed_buffering = true;
|
||||
}
|
||||
|
||||
return obs_reset_audio2(&ai);
|
||||
}
|
||||
|
||||
extern char *get_new_source_name(const char *name, const char *format);
|
||||
|
||||
Reference in New Issue
Block a user