yum-archive/TaSTT-Whisper
High-performance GPGPU inference of OpenAI's Whisper automatic speech recognition (ASR) model
git clone https://git.yummers.dev/yum-archive/TaSTT-Whisper
aaa0188
master
1#pragma once 2 3namespace Whisper 4{ 5struct sCaptureDevice 6 { 7// The display name is suitable for showing to the user, but might not be unique. 8const wchar_t * displayName ; 9 10// Endpoint ID for an audio capture device 11// It uniquely identifies the device on the system, but is not a readable string. 12const wchar_t * endpoint ; 13 }; 14 15using pfnFoundCaptureDevices = HRESULT (__stdcall * )( int len, const sCaptureDevice * buffer, void * pv ); 16 17// Flags for the audio capture 18enum struct eCaptureFlags : uint32_t 19{ 20// When the capture device supports stereo, keep stereo PCM samples in addition to mono 21Stereo = 1 , 22// Don't use voice activity detection (VAD). 23DisableVAD = 2 , 24}; 25 26// Parameters for audio capture 27struct sCaptureParams 28{ 29float minDuration = 2.0f ; 30float maxDuration = 3.0f ; 31float dropStartSilence = 0.25f ; 32float pauseDuration = 0.333f ; 33// After audio is segmented using VAD, as many as this many seconds of 34// audio will be retained as the input to the next transcription window. 35float retainDuration = 0.25f ; 36// Flags for the audio capture 37uint32_t flags = 0 ; 38}; 39 40enum struct eCaptureStatus : uint8_t 41{ 42Listening = 1 , 43Voice = 2 , 44Transcribing = 4 , 45Stalled = 0x80 , 46}; 47 48// Return S_OK to continue, or S_FALSE to stop the capture session 49using pfnShouldCancel = HRESULT ( __stdcall * )( void * pv ) noexcept; 50 51using pfnCaptureStatus = HRESULT ( __stdcall * )( void * pv, eCaptureStatus status ) noexcept; 52 53struct sCaptureCallbacks 54{ 55pfnShouldCancel shouldCancel ; 56pfnCaptureStatus captureStatus ; 57void * pv ; 58 }; 59}