Fix audio clock drift and adaptive jitter buffering
.NET port / test (macos-latest) (push) Canceled after 0s
.NET port / test (ubuntu-24.04) (push) Canceled after 0s
.NET port / test (windows-latest) (push) Canceled after 0s
.NET port / apple-client (push) Canceled after 0s

This commit is contained in:
2026-09-20 16:26:03 +02:00
parent 3ee0df11a9
commit dd811a0bb8
23 changed files with 401 additions and 61 deletions
@@ -55,6 +55,16 @@ public sealed partial class VoiceCatClient
public VcResult SetOutputVolume(float gain) { if (!float.IsFinite(gain) || gain is < 0 or > 4) return VcResult.InvalidArg; core.Audio.OutputGain = gain; return VcResult.Ok; }
public VcResult SetInputGain(float gain) { if (!float.IsFinite(gain) || gain is < 0 or > 4) return VcResult.InvalidArg; core.Audio.InputGain = gain; return VcResult.Ok; }
public VcResult SetInputNoiseReduction(bool enabled) { core.Audio.InputNoiseReduction = enabled; return VcResult.Ok; }
public VcResult SetAudioBufferMilliseconds(int milliseconds)
{
try
{
core.Audio.DeviceBufferMilliseconds = milliseconds;
if (Volatile.Read(ref playback) is { } output) output.BufferMilliseconds = milliseconds;
return VcResult.Ok;
}
catch (ArgumentOutOfRangeException) { return VcResult.InvalidArg; }
}
public VcResult SetRemoteStream(uint userId, uint streamId, float gain, bool muted, bool nr)
{ try { core.Audio.SetRemotePlayback(userId, streamId, gain, muted, nr); return VcResult.Ok; } catch { return VcResult.InvalidArg; } }
public (VcResult Result, RemoteStreamState? State) GetRemoteStream(uint userId, uint streamId)