From 8c4603c73675958efc960fbd4bb599a2909d106a Mon Sep 17 00:00:00 2001 From: Konstantin Date: Mon, 16 Jan 2023 14:52:43 +0100 Subject: Source codes --- WhisperNet/Internal/sCaptureDevice.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 WhisperNet/Internal/sCaptureDevice.cs (limited to 'WhisperNet/Internal/sCaptureDevice.cs') diff --git a/WhisperNet/Internal/sCaptureDevice.cs b/WhisperNet/Internal/sCaptureDevice.cs new file mode 100644 index 0000000..e2d524d --- /dev/null +++ b/WhisperNet/Internal/sCaptureDevice.cs @@ -0,0 +1,22 @@ +#pragma warning disable CS0649 // Field is never assigned to +using System.Runtime.InteropServices; + +namespace Whisper.Internal +{ + /// Identifiers for an audio capture device + public struct sCaptureDevice + { + readonly IntPtr m_displayName; + /// The display name is suitable for showing to the user, but might not be unique. + public string? displayName => Marshal.PtrToStringUni( m_displayName ); + + readonly IntPtr m_endpoint; + /// Endpoint ID for an audio capture device.
+ /// It uniquely identifies the device on the system, but is not a readable string.
+ public string? endpoint => Marshal.PtrToStringUni( m_endpoint ); + } + + /// Function pointer to consume a list of audio capture device IDs + [UnmanagedFunctionPointer( CallingConvention.StdCall )] + public delegate int pfnFoundCaptureDevices( int len, [In, MarshalAs( UnmanagedType.LPArray, SizeParamIndex = 0 )] sCaptureDevice[]? arr, IntPtr pv ); +} \ No newline at end of file -- cgit v1.2.3