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

Wrapper of native C++ whisper parameters. Use it to safely change inference parameters. More...

Static Public Member Functions

static WhisperParams GetDefaultParams (WhisperSamplingStrategy strategy=WhisperSamplingStrategy.WHISPER_SAMPLING_GREEDY)
 

Properties

WhisperNativeParams NativeParams [get]
 Native C++ struct parameters. Do not change it in runtime directly, use setters.
 
WhisperSamplingStrategy Strategy [get, set]
 Sampling Whisper strategy (greedy or beam search).
 
int ThreadsCount [get, set]
 Count of threads (n_threads), should be >= 1.
 
int MaxTextContextCount [get, set]
 Max tokens to use from past text as prompt for the decoder.
 
int OffsetMs [get, set]
 Start audio offset in ms.
 
int DurationMs [get, set]
 Audio duration to process in ms.
 
bool Translate [get, set]
 Translate from source language to English.
 
bool NoContext [get, set]
 Do not use past transcription (if any) as initial prompt for the decoder.
 
bool SingleSegment [get, set]
 Force single segment output (useful for streaming).
 
bool PrintSpecial [get, set]
 Print special tokens (e.g. SOT, EOT, BEG, etc.)
 
bool PrintProgress [get, set]
 Print progress information in C++ log. It won't be shown in Unity console, but visible in Unity log file. Log file location.
 
bool PrintRealtime [get, set]
 Print results from within whisper.cpp in C++ log (avoid it, use callback instead). It won't be shown in Unity console, but visible in Unity log file. Log file location.
 
bool PrintTimestamps [get, set]
 Print timestamps for each text segment when printing realtime in C++ log. It won't be shown in Unity console, but visible in Unity log file. Log file location.
 
string Language [get, set]
 Output text language code (ISO 639-1). For example "en", "es" or "de". For auto-detection, set to null, "" or "auto".
 
string InitialPrompt [get, set]
 initial prompt is converted to tokens and prepended to any existing text context from a previous call Using example
 
bool TokenTimestamps [get, set]
 [EXPERIMENTAL] Try to estimate timestamps for each token in segment.
 
bool SpeedUp [get, set]
 [EXPERIMENTAL] Speed-up the audio by 2x using Phase Vocoder. These can significantly reduce the quality of the output.
 
int AudioCtx [get, set]
 [EXPERIMENTAL] Overwrite the audio context size (0 = use default). These can significantly reduce the quality of the output.
 
whisper_new_segment_callback NewSegmentCallback [get, set]
 Called for every newly generated text segment. Because of IL2CPP, this should be a static function. WhisperWrapper and WhisperManager will use it to raise their custom event.
 
IntPtr NewSegmentCallbackUserData [get, set]
 Pointer to data that you want to pass as a parameter for NewSegmentCallback. It will be relayed from whisper code without any changes.
 
whisper_progress_callback ProgressCallback [get, set]
 Called on each progress update. Because of IL2CPP, this should be a static function. WhisperWrapper and WhisperManager will use it to raise their custom event.
 
IntPtr ProgressCallbackUserData [get, set]
 Pointer to data that you want to pass as a parameter for ProgressCallback. It will be relayed from whisper code without any changes.
 
bool EnableTokens [get, set]
 Output in WhisperSegment list of tokens.
 

Detailed Description

Wrapper of native C++ whisper parameters. Use it to safely change inference parameters.

Member Function Documentation

◆ GetDefaultParams()

static WhisperParams Whisper.WhisperParams.GetDefaultParams ( WhisperSamplingStrategy strategy = WhisperSamplingStrategy::WHISPER_SAMPLING_GREEDY)
inlinestatic

Property Documentation

◆ AudioCtx

int Whisper.WhisperParams.AudioCtx
getset

[EXPERIMENTAL] Overwrite the audio context size (0 = use default). These can significantly reduce the quality of the output.

◆ DurationMs

int Whisper.WhisperParams.DurationMs
getset

Audio duration to process in ms.

◆ EnableTokens

bool Whisper.WhisperParams.EnableTokens
getset

Output in WhisperSegment list of tokens.

◆ InitialPrompt

string Whisper.WhisperParams.InitialPrompt
getset

initial prompt is converted to tokens and prepended to any existing text context from a previous call Using example

◆ Language

string Whisper.WhisperParams.Language
getset

Output text language code (ISO 639-1). For example "en", "es" or "de". For auto-detection, set to null, "" or "auto".

Input audio can be in any language. Whisper will try to translate your audio to selected language. If you want to translate into English use Translate for better quality.

◆ MaxTextContextCount

int Whisper.WhisperParams.MaxTextContextCount
getset

Max tokens to use from past text as prompt for the decoder.

◆ NativeParams

WhisperNativeParams Whisper.WhisperParams.NativeParams
get

Native C++ struct parameters. Do not change it in runtime directly, use setters.

◆ NewSegmentCallback

whisper_new_segment_callback Whisper.WhisperParams.NewSegmentCallback
getset

Called for every newly generated text segment. Because of IL2CPP, this should be a static function. WhisperWrapper and WhisperManager will use it to raise their custom event.

◆ NewSegmentCallbackUserData

IntPtr Whisper.WhisperParams.NewSegmentCallbackUserData
getset

Pointer to data that you want to pass as a parameter for NewSegmentCallback. It will be relayed from whisper code without any changes.

◆ NoContext

bool Whisper.WhisperParams.NoContext
getset

Do not use past transcription (if any) as initial prompt for the decoder.

◆ OffsetMs

int Whisper.WhisperParams.OffsetMs
getset

Start audio offset in ms.

◆ PrintProgress

bool Whisper.WhisperParams.PrintProgress
getset

Print progress information in C++ log. It won't be shown in Unity console, but visible in Unity log file. Log file location.

◆ PrintRealtime

bool Whisper.WhisperParams.PrintRealtime
getset

Print results from within whisper.cpp in C++ log (avoid it, use callback instead). It won't be shown in Unity console, but visible in Unity log file. Log file location.

◆ PrintSpecial

bool Whisper.WhisperParams.PrintSpecial
getset

Print special tokens (e.g. SOT, EOT, BEG, etc.)

◆ PrintTimestamps

bool Whisper.WhisperParams.PrintTimestamps
getset

Print timestamps for each text segment when printing realtime in C++ log. It won't be shown in Unity console, but visible in Unity log file. Log file location.

◆ ProgressCallback

whisper_progress_callback Whisper.WhisperParams.ProgressCallback
getset

Called on each progress update. Because of IL2CPP, this should be a static function. WhisperWrapper and WhisperManager will use it to raise their custom event.

◆ ProgressCallbackUserData

IntPtr Whisper.WhisperParams.ProgressCallbackUserData
getset

Pointer to data that you want to pass as a parameter for ProgressCallback. It will be relayed from whisper code without any changes.

◆ SingleSegment

bool Whisper.WhisperParams.SingleSegment
getset

Force single segment output (useful for streaming).

◆ SpeedUp

bool Whisper.WhisperParams.SpeedUp
getset

[EXPERIMENTAL] Speed-up the audio by 2x using Phase Vocoder. These can significantly reduce the quality of the output.

◆ Strategy

WhisperSamplingStrategy Whisper.WhisperParams.Strategy
getset

Sampling Whisper strategy (greedy or beam search).

◆ ThreadsCount

int Whisper.WhisperParams.ThreadsCount
getset

Count of threads (n_threads), should be >= 1.

◆ TokenTimestamps

bool Whisper.WhisperParams.TokenTimestamps
getset

[EXPERIMENTAL] Try to estimate timestamps for each token in segment.

◆ Translate

bool Whisper.WhisperParams.Translate
getset

Translate from source language to English.

Generally improves English translation. Override Language parameter. If you want to translate to another language, set this to false and use Language parameter.


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