Method SetRecordDirectoryAsync
- Namespace
- OBSStudioClient.Model
- Assembly
- OBSClient.dll
SetRecordDirectoryAsync(string, CancellationToken)
Changes the folder that OBS Studio records to (for the profile that is current), and returns when OBS Studio has made the change.
public Task SetRecordDirectoryAsync(string directory, CancellationToken cancellationToken = default)
Parameters
directorystringThe folder: a path of the computer that OBS Studio runs on.
cancellationTokenCancellationTokenA token that ends the wait. A change that was not sent yet is not sent.
Returns
- Task
A task that completes when OBS Studio has answered that it made the change.
Remarks
OBS Studio sets the folder of both output modes, simple and advanced, and does not check that it exists. It does not change it while it records. The model does not keep the folder, so the call has nothing to wait for but the answer of OBS Studio: ask what it holds with GetRecordDirectoryAsync(CancellationToken). See SetEnabledAsync(bool, CancellationToken) for the order of changes.
Exceptions
- ArgumentException
directoryis empty.- 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.
- ObsResponseException
OBS Studio refused the change: it is recording (ErrorCode is OutputRunning).