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

KonstantinMinor, UX enhancementse771695

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