summaryrefslogtreecommitdiffstats
path: root/WhisperNet/API/CaptureDeviceId.cs
diff options
context:
space:
mode:
authorKonstantin <const@const.me>2023-01-16 14:52:43 +0100
committerKonstantin <const@const.me>2023-01-16 14:52:43 +0100
commit8c4603c73675958efc960fbd4bb599a2909d106a (patch)
tree714dc6fc9a1672d5fd7f89676b97e10959662abc /WhisperNet/API/CaptureDeviceId.cs
parent990a8d0dbaefc996244097397259e92758b15cce (diff)
Source codes
Diffstat (limited to 'WhisperNet/API/CaptureDeviceId.cs')
-rw-r--r--WhisperNet/API/CaptureDeviceId.cs24
1 files changed, 24 insertions, 0 deletions
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
+{
+ /// <summary>Identifiers for an audio capture device</summary>
+ public record struct CaptureDeviceId
+ {
+ /// <summary>The display name is suitable for showing to the user, but might not be unique.</summary>
+ public string displayName;
+
+ /// <summary>Endpoint ID for an audio capture device.<br/>
+ /// It uniquely identifies the device on the system, but is not a readable string.</summary>
+ public string endpoint;
+
+ internal CaptureDeviceId( in sCaptureDevice rsi )
+ {
+ displayName = rsi.displayName ?? "<display name unavailable>";
+ endpoint = rsi.endpoint ?? throw new ApplicationException( "The device has no endpoint ID" );
+ }
+
+ /// <summary>Returns a String which represents the object instance</summary>
+ public override string ToString() => $"Capture device: \"{displayName}\"";
+ }
+} \ No newline at end of file