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
e771695
master
1#pragma once 2#include "Utils/DebugConsole.h" 3 4class AppState 5{ 6bool coInit = false; 7CRegKey registryKey ; 8CIcon appIcon ; 9public : 10 11struct ModelSource 12 { 13CString path ; 14bool found = false; 15Whisper ::eModelImplementation impl = (Whisper ::eModelImplementation )0 ; 16uint64_t sizeInBytes = 0 ; 17 }; 18ModelSource source; 19 20DebugConsole console; 21CComPtr < Whisper::iMediaFoundation > mediaFoundation; 22CComPtr < Whisper::iModel > model; 23 24~ AppState (); 25 26// Setup the initial things 27HRESULT startup (); 28 29HRESULT findModelSource (); 30 31HRESULT saveModelSource (); 32 33uint32_t languageRead (); 34void languageWrite ( uint32_t key ); 35 36CString stringLoad ( LPCTSTR name ); 37void stringStore ( LPCTSTR name, LPCTSTR value ); 38uint32_t dwordLoad ( LPCTSTR name, uint32_t fallback ); 39void dwordStore ( LPCTSTR name, uint32_t value ); 40bool boolLoad ( LPCTSTR name ); 41void boolStore ( LPCTSTR name, bool val ); 42 43bool automaticallyLoadModel = true; 44 45void lastScreenSave ( HRESULT code ); 46HRESULT lastScreenLoad (); 47 48void setupIcon ( CWindow * wnd ); 49 50uint32_t gpuFlagsLoad (); 51void gpuFlagsStore ( uint32_t flags ); 52}; 53 54constexpr HRESULT SCREEN_MODEL = 1 ; 55constexpr HRESULT SCREEN_TRANSCRIBE = 2 ; 56constexpr HRESULT SCREEN_CAPTURE = 3 ;