using ComLight; using System.Runtime.InteropServices; using Whisper.Internal; namespace Whisper { /// Exposes a small subset of MS Media Foundation framework. /// That framework is a part of Windows OS, since Vista. /// [ComInterface( "fb9763a5-d77d-4b6e-aff8-f494813cebd8", eMarshalDirection.ToManaged ), CustomConventions( typeof( NativeLogger ) )] public interface iMediaFoundation: IDisposable { /// Decode complete audio file into a new memory buffer. /// /// The method asks MF to resample and convert audio into the suitable type for the Whisper model.
/// If the path is a video file, the method will decode the first audio track. ///
[RetValIndex( 2 )] iAudioBuffer loadAudioFile( [MarshalAs( UnmanagedType.LPWStr )] string path, [MarshalAs( UnmanagedType.U1 )] bool stereo = false ); /// Create a reader to stream the audio file from disk /// /// The method returns an object which can be used to decode the audio file incrementally.
/// 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).
/// If the path is a video file, the implementation will use the first audio track. ///
[RetValIndex( 2 )] iAudioReader openAudioFile( [MarshalAs( UnmanagedType.LPWStr )] string path, [MarshalAs( UnmanagedType.U1 )] bool stereo = false ); /// List capture devices void listCaptureDevices( [MarshalAs( UnmanagedType.FunctionPtr )] pfnFoundCaptureDevices pfn, IntPtr pv ); /// Open audio capture device [RetValIndex( 2 )] iAudioCapture openCaptureDevice( [MarshalAs( UnmanagedType.LPWStr )] string endpoint, [In] ref sCaptureParams captureParams ); } }