using ComLight; using System.Runtime.InteropServices; using Whisper.Internals; namespace Whisper.Internal { /// Stateful context, contains methods to transcribe audio [ComInterface( "b9956374-3b18-4943-90f2-2ab18a404537", eMarshalDirection.ToManaged ), CustomConventions( typeof( NativeLogger ) )] public interface iContext: IDisposable { /// Run the entire model: PCM -> log mel spectrogram -> encoder -> decoder -> text void runFull( [In] ref sFullParams @params, iAudioBuffer buffer ); /// Run the entire model, streaming audio from the provided reader object void runStreamed( [In] ref sFullParams @params, [In] ref sProgressSink progressSink, iAudioReader reader ); /// Continuously process audio from microphone or a similar capture device void runCapture( [In] ref sFullParams @params, [In] ref sCaptureCallbacks callbacks, iAudioCapture reader ); /// Get text results out of the context [RetValIndex( 1 )] iTranscribeResult getResults( eResultFlags flags ); /// Try to detect speaker by comparing channels of the stereo PCM data [RetValIndex( 1 )] eSpeakerChannel detectSpeaker( [In] ref sTimeInterval interval ); /// Get the model which was used to create this context [RetValIndex] iModel getModel(); /// Full the default parameters of the model, for the specified sampling strategy [RetValIndex( 1 )] sFullParams fullDefaultParams( eSamplingStrategy strategy ); /// Print timing data void timingsPrint(); /// Reset timing data void timingsReset(); } }