FirstModulAR 0.1.0
Loading...
Searching...
No Matches
Whisper.WhisperStream Class Reference

Handling all streaming logic (sliding-window, VAD, etc). More...

Public Member Functions

 WhisperStream (WhisperWrapper wrapper, WhisperStreamParams param, MicrophoneRecord microphone=null)
 Create a new instance of Whisper streaming transcription.
 
void StartStream ()
 Start a new streaming transcription. Must be called before you start adding new audio chunks.
 
async void AddToStream (AudioChunk chunk)
 Manually add a new chunk of audio to streaming. Make sure to call StartStream first.
 
async void StopStream ()
 Stop current streaming transcription. It will process last audio chunks and raise OnStreamFinished when it's done.
 

Events

OnStreamResultUpdatedDelegate OnResultUpdated
 Raised when whisper updated stream transcription. Result contains a full stream transcript from the stream beginning.
 
OnStreamSegmentUpdatedDelegate OnSegmentUpdated
 Raised when whisper updated current segment transcript.
 
OnStreamSegmentFinishedDelegate OnSegmentFinished
 Raised when whisper finished current segment transcript.
 
OnStreamFinishedDelegate OnStreamFinished
 Raised when whisper finished stream transcription and can start another one.
 

Detailed Description

Handling all streaming logic (sliding-window, VAD, etc).

Constructor & Destructor Documentation

◆ WhisperStream()

Whisper.WhisperStream.WhisperStream ( WhisperWrapper wrapper,
WhisperStreamParams param,
MicrophoneRecord microphone = null )
inline

Create a new instance of Whisper streaming transcription.

Parameters
wrapperLoaded Whisper model which will be used for transcription.
paramWhisper streaming parameters.
microphoneOptional microphone input for stream.

Member Function Documentation

◆ AddToStream()

async void Whisper.WhisperStream.AddToStream ( AudioChunk chunk)
inline

Manually add a new chunk of audio to streaming. Make sure to call StartStream first.

If you set microphone into constructor, it will be called automatically.

◆ StartStream()

void Whisper.WhisperStream.StartStream ( )
inline

Start a new streaming transcription. Must be called before you start adding new audio chunks.

If you set microphone into constructor, it will start listening to it. Make sure you started microphone by MicrophoneRecord.StartRecord. There is no need to add audio chunks manually using AddToStream.

◆ StopStream()

async void Whisper.WhisperStream.StopStream ( )
inline

Stop current streaming transcription. It will process last audio chunks and raise OnStreamFinished when it's done.

Event Documentation

◆ OnResultUpdated

OnStreamResultUpdatedDelegate Whisper.WhisperStream.OnResultUpdated

Raised when whisper updated stream transcription. Result contains a full stream transcript from the stream beginning.

◆ OnSegmentFinished

OnStreamSegmentFinishedDelegate Whisper.WhisperStream.OnSegmentFinished

Raised when whisper finished current segment transcript.

◆ OnSegmentUpdated

OnStreamSegmentUpdatedDelegate Whisper.WhisperStream.OnSegmentUpdated

Raised when whisper updated current segment transcript.

◆ OnStreamFinished

OnStreamFinishedDelegate Whisper.WhisperStream.OnStreamFinished

Raised when whisper finished stream transcription and can start another one.


The documentation for this class was generated from the following file: