diff options
| author | Konstantin <const@const.me> | 2023-01-16 14:52:43 +0100 |
|---|---|---|
| committer | Konstantin <const@const.me> | 2023-01-16 14:52:43 +0100 |
| commit | 8c4603c73675958efc960fbd4bb599a2909d106a (patch) | |
| tree | 714dc6fc9a1672d5fd7f89676b97e10959662abc /Whisper/API/MfStructs.h | |
| parent | 990a8d0dbaefc996244097397259e92758b15cce (diff) | |
Source codes
Diffstat (limited to 'Whisper/API/MfStructs.h')
| -rw-r--r-- | Whisper/API/MfStructs.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Whisper/API/MfStructs.h b/Whisper/API/MfStructs.h new file mode 100644 index 0000000..cd27659 --- /dev/null +++ b/Whisper/API/MfStructs.h @@ -0,0 +1,51 @@ +#pragma once + +namespace Whisper +{ + struct sCaptureDevice + { + // The display name is suitable for showing to the user, but might not be unique. + const wchar_t* displayName; + + // Endpoint ID for an audio capture device + // It uniquely identifies the device on the system, but is not a readable string. + const wchar_t* endpoint; + }; + + using pfnFoundCaptureDevices = HRESULT( __stdcall* )( int len, const sCaptureDevice* buffer, void* pv ); + + // Flags for the audio capture + enum struct eCaptureFlags : uint32_t + { + // When the capture device supports stereo, keep stereo PCM samples in addition to mono + Stereo = 1, + }; + + // Parameters for audio capture + struct sCaptureParams + { + float minDuration = 2.0f; + float maxDuration = 3.0f; + float dropStartSilence = 0.25f; + float pauseDuration = 0.333f; + // Flags for the audio capture + uint32_t flags = 0; + }; + + enum struct eCaptureStatus : uint8_t + { + Listening = 1, + Voice = 2, + Transcribing = 4, + Stalled = 0x80, + }; + + using pfnShouldCancel = HRESULT( __stdcall* )( void* pv ) noexcept; + using pfnCaptureStatus = HRESULT( __stdcall* )( void* pv, eCaptureStatus status ) noexcept; + struct sCaptureCallbacks + { + pfnShouldCancel shouldCancel; + pfnCaptureStatus captureStatus; + void* pv; + }; +}
\ No newline at end of file |
