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
6238fc3
master
1using ComLight ; 2using System . Runtime . InteropServices ; 3using Whisper . Internal ; 4 5namespace Whisper 6{ 7/// <summary>Exposes a small subset of MS Media Foundation framework.</summary> 8/// <remarks>That framework is a part of Windows OS, since Vista.</remarks> 9/// <seealso href="https://learn.microsoft.com/en-us/windows/win32/medfound/microsoft-media-foundation-sdk" /> 10[ ComInterface ( "fb9763a5-d77d-4b6e-aff8-f494813cebd8" , eMarshalDirection . ToManaged ), CustomConventions ( typeof ( NativeLogger ) )] 11public interface iMediaFoundation : IDisposable 12{ 13/// <summary>Decode complete audio file into a new memory buffer.</summary> 14/// <returns> 15/// The method asks MF to resample and convert audio into the suitable type for the Whisper model.<br/> 16/// If the path is a video file, the method will decode the first audio track. 17/// </returns> 18[ RetValIndex ( 2 )] 19iAudioBuffer loadAudioFile ( [ MarshalAs ( UnmanagedType . LPWStr )] string path , [ MarshalAs ( UnmanagedType . U1 )] bool stereo = false ); 20 21/// <summary>Create a reader to stream the audio file from disk</summary> 22/// <returns> 23/// The method returns an object which can be used to decode the audio file incrementally.<br/> 24/// For long audio files, this saves both memory (no need for large uncompressed PCM buffer), and time (decode and transcribe run concurrently on different CPU threads).<br/> 25/// If the path is a video file, the implementation will use the first audio track. 26/// </returns> 27[ RetValIndex ( 2 )] 28iAudioReader openAudioFile ( [ MarshalAs ( UnmanagedType . LPWStr )] string path , [ MarshalAs ( UnmanagedType . U1 )] bool stereo = false ); 29 30/// <summary>List capture devices</summary> 31void listCaptureDevices ( [ MarshalAs ( UnmanagedType . FunctionPtr )] pfnFoundCaptureDevices pfn , IntPtr pv ); 32 33/// <summary>Open audio capture device</summary> 34[ RetValIndex ( 2 )] 35iAudioCapture openCaptureDevice ( [ MarshalAs ( UnmanagedType . LPWStr )] string endpoint , [ In ] ref sCaptureParams captureParams ); 36} 37}