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

KonstantinDLL API for diarize featuree1e3ac0

master
2.3 KiB64 linesraw
1#pragma once
2#include "iTranscribeResult.h"
3#include "SpecialTokens.h"
4#include "loggerApi.h"
5#include "sLanguageList.h"
6#include "sLoadModelCallbacks.h"
7#include "eGpuModelFlags.h"
8
9namespace Whisper
10{
11	__interface iModel;
12	__interface iAudioBuffer;
13	__interface iAudioReader;
14	__interface iAudioCapture;
15	struct sCaptureCallbacks;
16	struct sFullParams;
17	enum struct eModelImplementation : uint32_t;
18	enum struct eSamplingStrategy : int;
19	using whisper_token = int;
20	struct sProgressSink;
21
22	__interface __declspec( novtable, uuid( "b9956374-3b18-4943-90f2-2ab18a404537" ) ) iContext : public IUnknown
23	{
24		// Run the entire model: PCM -> log mel spectrogram -> encoder -> decoder -> text
25		// Uses the specified decoding strategy to obtain the text.
26		HRESULT __stdcall runFull( const sFullParams& params, const iAudioBuffer* buffer );
27		HRESULT __stdcall runStreamed( const sFullParams& params, const sProgressSink& progress, const iAudioReader* reader );
28		HRESULT __stdcall runCapture( const sFullParams& params, const sCaptureCallbacks& callbacks, const iAudioCapture* reader );
29
30		HRESULT __stdcall getResults( eResultFlags flags, iTranscribeResult** pp ) const;
31		// Try to detect speaker by comparing channels of the stereo PCM data
32		HRESULT __stdcall detectSpeaker( const sTimeInterval& time, eSpeakerChannel& result ) const;
33
34		HRESULT __stdcall getModel( iModel** pp );
35
36		HRESULT __stdcall fullDefaultParams( eSamplingStrategy strategy, sFullParams* rdi );
37
38		// Performance information
39		HRESULT __stdcall timingsPrint();
40		HRESULT __stdcall timingsReset();
41	};
42
43	__interface __declspec( novtable, uuid( "abefb4c9-e8d8-46a3-8747-5afbadef1adb" ) ) iModel : public IUnknown
44	{
45		HRESULT __stdcall createContext( iContext** pp );
46
47		HRESULT __stdcall isMultilingual();
48
49		HRESULT __stdcall getSpecialTokens( SpecialTokens& rdi );
50
51		// Token Id -> String
52		const char* __stdcall stringFromToken( whisper_token token );
53	};
54
55	HRESULT __stdcall setupLogger( const sLoggerSetup& setup );
56	HRESULT __stdcall loadModel( const wchar_t* path, eModelImplementation impl, uint32_t flags, const sLoadModelCallbacks* callbacks, iModel** pp );
57
58	uint32_t __stdcall findLanguageKeyW( const wchar_t* lang );
59	uint32_t __stdcall findLanguageKeyA( const char* lang );
60
61	HRESULT __stdcall getSupportedLanguages( sLanguageList& rdi );
62}
63
64#include "sFullParams.h"