mirror of
https://github.com/Const-me/Whisper.git
synced 2026-10-18 21:20:33 +08:00
25 lines
861 B
C#
25 lines
861 B
C#
using System;
|
|
using Whisper.Internal;
|
|
|
|
namespace Whisper
|
|
{
|
|
/// <summary>Identifiers for an audio capture device</summary>
|
|
public 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}\"";
|
|
}
|
|
} |