From 8c4603c73675958efc960fbd4bb599a2909d106a Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 16 Jan 2023 14:52:43 +0100 Subject: Source codes --- WhisperNet/API/CaptureDeviceId.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 WhisperNet/API/CaptureDeviceId.cs (limited to 'WhisperNet/API/CaptureDeviceId.cs') diff --git a/WhisperNet/API/CaptureDeviceId.cs b/WhisperNet/API/CaptureDeviceId.cs new file mode 100644 index 0000000..9636e53 --- /dev/null +++ b/WhisperNet/API/CaptureDeviceId.cs @@ -0,0 +1,24 @@ +using Whisper.Internal; + +namespace Whisper +{ + /// Identifiers for an audio capture device + public record struct CaptureDeviceId + { + /// The display name is suitable for showing to the user, but might not be unique. + public string displayName; + + /// Endpoint ID for an audio capture device.
+ /// It uniquely identifies the device on the system, but is not a readable string.
+ public string endpoint; + + internal CaptureDeviceId( in sCaptureDevice rsi ) + { + displayName = rsi.displayName ?? ""; + endpoint = rsi.endpoint ?? throw new ApplicationException( "The device has no endpoint ID" ); + } + + /// Returns a String which represents the object instance + public override string ToString() => $"Capture device: \"{displayName}\""; + } +} \ No newline at end of file -- cgit v1.2.3