Method SetSyncOffsetAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
SetSyncOffsetAsync(TimeSpan, CancellationToken)
Sets how much the audio of the input is delayed or advanced, and returns when the model shows it.
public Task SetSyncOffsetAsync(TimeSpan offset, CancellationToken cancellationToken = default)
Parameters
offsetTimeSpanThe offset: from -950 ms to 20 s, in whole milliseconds (a part of a millisecond is rounded). A positive offset delays the audio, a negative one advances it.
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
- Task
A task that completes when SyncOffset is
offset.
Remarks
See SetEnabledAsync(bool, CancellationToken) for the order of changes and the wait.
Exceptions
- ArgumentOutOfRangeException
offsetis not from -950 ms to 20 s.- InvalidOperationException
The input has no audio (HasAudio).
- ObsRemovedException
The input was removed.
- ObsNotConnectedException
There is no connection to OBS Studio. Nothing was changed.
- ObsNotReadyException
OBS Studio is changing its scene collection, or did so after the call. Nothing was changed.
- ObsUnknownOutcomeException
OBS Studio did not answer in time, or the connection ended: it is not known whether it made the change.
- ObsNotConfirmedException
OBS Studio made the change, and the model does not show it: the events did not show it in time, and the model could not be read again in time. Do not send the change again.
- ObsResponseException
OBS Studio refused the change.