Personal .NET implementation of obs-websocket protocol v5.
Difference to obs-websocket-dotnet
ObsStrawket | obs-websocket-dotnet | |
---|---|---|
Dependencies | System.Net.WebSockets MessagePack |
WebSocket.Client Newtonsoft.Json |
Method type | Asynchronous | Synchronous |
var client = new ObsClientSocket();
await client.ConnectAsync(new Uri("ws://localhost:4455"), "ahrEYXzXKytCIlpI");
var version = await client.GetVersionAsync();
Assert.Contains("bmp", version.SupportedImageFormats);
// Listen specific event.
client.RecordStateChanged += (changed) => {
switch (changed.OutputState) {
case ObsOutputState.Unknown:
case ObsOutputState.Starting:
case ObsOutputState.Started:
case ObsOutputState.Stopping:
case ObsOutputState.Stopped:
case ObsOutputState.Paused:
case ObsOutputState.Resumed:
break;
}
};
// Listen all events and filter.
client.Event += (ev) => {
switch (ev) {
case RecordStateChanged changed:
break;
}
};
await client.StartRecordAsync();
await client.CloseAsync();
- InputActiveStateChanged
- InputShowStateChanged
- InputVolumeMeters
- SceneItemTransformChanged
- VendorEvent
- CallVendorRequest