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

KonstantinSource codes8c4603c

master
1.8 KiB48 linesraw
1#pragma once
2#include "../../ComLightLib/comLightCommon.h"
3#include "MfStructs.h"
4
5struct IMFSourceReader;
6
7namespace Whisper
8{
9	struct DECLSPEC_NOVTABLE iAudioBuffer : public ComLight::IUnknown
10	{
11		DEFINE_INTERFACE_ID( "{013583aa-c9eb-42bc-83db-633c2c317051}" );
12
13		virtual uint32_t COMLIGHTCALL countSamples() const = 0;
14		virtual const float* COMLIGHTCALL getPcmMono() const = 0;
15		virtual const float* COMLIGHTCALL getPcmStereo() const = 0;
16		virtual HRESULT COMLIGHTCALL getTime( int64_t& rdi ) const = 0;
17	};
18
19	struct DECLSPEC_NOVTABLE iAudioReader : public ComLight::IUnknown
20	{
21		DEFINE_INTERFACE_ID( "{35b988da-04a6-476a-a193-d8891d5dc390}" );
22
23		virtual HRESULT COMLIGHTCALL getDuration( int64_t& rdi ) const = 0;
24		virtual HRESULT COMLIGHTCALL getReader( IMFSourceReader** pp ) const = 0;
25		virtual HRESULT COMLIGHTCALL requestedStereo() const = 0;
26	};
27
28	struct DECLSPEC_NOVTABLE iAudioCapture : public ComLight::IUnknown
29	{
30		DEFINE_INTERFACE_ID( "{747752c2-d9fd-40df-8847-583c781bf013}" );
31
32		virtual HRESULT COMLIGHTCALL getReader( IMFSourceReader** pp ) const = 0;
33		virtual const sCaptureParams& COMLIGHTCALL getParams() const = 0;
34	};
35
36	struct DECLSPEC_NOVTABLE iMediaFoundation : public ComLight::IUnknown
37	{
38		DEFINE_INTERFACE_ID( "{fb9763a5-d77d-4b6e-aff8-f494813cebd8}" );
39
40		virtual HRESULT COMLIGHTCALL loadAudioFile( LPCTSTR path, bool stereo, iAudioBuffer** pp ) const = 0;
41		virtual HRESULT COMLIGHTCALL openAudioFile( LPCTSTR path, bool stereo, iAudioReader** pp ) = 0;
42
43		virtual HRESULT COMLIGHTCALL listCaptureDevices( pfnFoundCaptureDevices pfn, void* pv ) = 0;
44		virtual HRESULT COMLIGHTCALL openCaptureDevice( LPCTSTR endpoint, const sCaptureParams& captureParams, iAudioCapture** pp ) = 0;
45	};
46
47	HRESULT COMLIGHTCALL initMediaFoundation( iMediaFoundation** pp );
48}