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

Wrapper for loaded whisper model. More...

Public Member Functions

WhisperResult GetText (AudioClip clip, WhisperParams param)
 Transcribes audio clip. Will block thread until transcription complete.
 
async Task< WhisperResultGetTextAsync (AudioClip clip, WhisperParams param)
 Start async transcription of audio clip.
 
WhisperResult GetText (float[] samples, int frequency, int channels, WhisperParams param)
 Transcribe audio buffer. Will block thread until transcription complete.
 
async Task< WhisperResultGetTextAsync (float[] samples, int frequency, int channels, WhisperParams param)
 Start async transcription of audio buffer.
 

Static Public Member Functions

static WhisperWrapper InitFromFile (string modelPath)
 Loads whisper model from file path.
 
static async Task< WhisperWrapperInitFromFileAsync (string modelPath)
 Start async loading of whisper model from file path.
 
static WhisperWrapper InitFromBuffer (byte[] buffer)
 Loads whisper model from byte buffer.
 
static async Task< WhisperWrapperInitFromBufferAsync (byte[] buffer)
 Start async loading of whisper model from byte buffer.
 

Static Public Attributes

const int WhisperSampleRate = 16000
 

Properties

bool IsMultilingual [get]
 Checks if currently loaded whisper model supports multilingual transcription.
 

Events

OnNewSegmentDelegate OnNewSegment
 Raised when whisper transcribed a new text segment from audio.
 
OnProgressDelegate OnProgress
 Raised when whisper made some progress in transcribing audio. Progress changes from 0 to 100 included.
 

Detailed Description

Wrapper for loaded whisper model.

Member Function Documentation

◆ GetText() [1/2]

WhisperResult Whisper.WhisperWrapper.GetText ( AudioClip clip,
WhisperParams param )
inline

Transcribes audio clip. Will block thread until transcription complete.

Returns
Full audio transcript. Null if transcription failed.

◆ GetText() [2/2]

WhisperResult Whisper.WhisperWrapper.GetText ( float[] samples,
int frequency,
int channels,
WhisperParams param )
inline

Transcribe audio buffer. Will block thread until transcription complete.

Parameters
samplesRaw audio buffer.
frequencyAudio sample rate.
channelsAudio channels count.
paramWhisper inference parameters.
Returns
Full audio transcript. Null if transcription failed.

◆ GetTextAsync() [1/2]

async Task< WhisperResult > Whisper.WhisperWrapper.GetTextAsync ( AudioClip clip,
WhisperParams param )
inline

Start async transcription of audio clip.

Returns
Full audio transcript. Null if transcription failed.

◆ GetTextAsync() [2/2]

async Task< WhisperResult > Whisper.WhisperWrapper.GetTextAsync ( float[] samples,
int frequency,
int channels,
WhisperParams param )
inline

Start async transcription of audio buffer.

Parameters
samplesRaw audio buffer.
frequencyAudio sample rate.
channelsAudio channels count.
paramWhisper inference parameters.
Returns
Full audio transcript. Null if transcription failed.

◆ InitFromBuffer()

static WhisperWrapper Whisper.WhisperWrapper.InitFromBuffer ( byte[] buffer)
inlinestatic

Loads whisper model from byte buffer.

Returns
Loaded whisper model. Null if loading failed.

◆ InitFromBufferAsync()

static async Task< WhisperWrapper > Whisper.WhisperWrapper.InitFromBufferAsync ( byte[] buffer)
inlinestatic

Start async loading of whisper model from byte buffer.

Returns
Loaded whisper model. Null if loading failed.

◆ InitFromFile()

static WhisperWrapper Whisper.WhisperWrapper.InitFromFile ( string modelPath)
inlinestatic

Loads whisper model from file path.

Parameters
modelPathAbsolute file path to model weights.
Returns
Loaded whisper model. Null if loading failed.

◆ InitFromFileAsync()

static async Task< WhisperWrapper > Whisper.WhisperWrapper.InitFromFileAsync ( string modelPath)
inlinestatic

Start async loading of whisper model from file path.

Parameters
modelPathAbsolute file path to model weights.
Returns
Loaded whisper model. Null if loading failed.

Member Data Documentation

◆ WhisperSampleRate

const int Whisper.WhisperWrapper.WhisperSampleRate = 16000
static

Property Documentation

◆ IsMultilingual

bool Whisper.WhisperWrapper.IsMultilingual
get

Checks if currently loaded whisper model supports multilingual transcription.

Event Documentation

◆ OnNewSegment

OnNewSegmentDelegate Whisper.WhisperWrapper.OnNewSegment

Raised when whisper transcribed a new text segment from audio.

Use MainThreadDispatcher for handling event in Unity main thread.

◆ OnProgress

OnProgressDelegate Whisper.WhisperWrapper.OnProgress

Raised when whisper made some progress in transcribing audio. Progress changes from 0 to 100 included.

Use MainThreadDispatcher for handling event in Unity main thread.


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