Skip to main content

Recognition Parameter List

These parameters can only be set while the recognizer is not running.

This is not an exhaustive list of parameters available in Whisper. Only the most important ones are exposed here. If necessary, this list will be updated.

Set Recognition Parameters​

Sets the parameters for speech recognition. If you want to change only specific parameters, consider using the individual setter functions.

Set Streaming Defaults​

Sets the default parameters suitable for streaming speech recognition.

warning

This function overwrites all previously applied parameters. Make sure to call this before setting your custom parameters if you need to use streaming defaults as a base configuration.

Set Non Streaming Defaults​

Sets the default parameters suitable for non-streaming speech recognition.

warning

This function overwrites all previously applied parameters. Make sure to call this before setting your custom parameters if you need to use non-streaming defaults as a base configuration.

Set Num Of Threads​

Sets the number of threads to use for speech recognition. Set this value to 0 to use the number of cores.

Set Language​

Sets the language to use for speech recognition. Must be supported by the selected language model in the Editor settings.

Setting the language to Auto will decrease the recognition accuracy and performance.

Get Detected Language​

Gets the detected language from the last recognition. Returns the language as an enum value.

Note: This function only works after recognition has been performed. It returns Auto if language detection failed or was not performed. This is particularly useful when using Auto language detection to identify which language was actually recognized.

Get Language Code​

Converts a language enum value to its language code string (e.g., En -> "en", Fr -> "fr", De -> "de").

Get Language Full Name​

Converts a language enum value to its full language name (e.g., En -> "English", Fr -> "French", De -> "German").

Set Translate To English​

Sets whether to translate the recognized words to English. If true, the language model must be multilingual.

Set Step Size​

Sets the step size in milliseconds. Determines how often to send audio data for recognition. The default value is 5000 ms (5 seconds).

Set No Context​

Sets whether to use past transcription (if any) as initial prompt for the decoder.

Set Single Segment​

Sets whether to force single segment output (useful for streaming).

Set Max Tokens​

Sets the maximum number of tokens per text segment. Use 0 for no limit.

Set Speed Up​

Sets whether to speed up the recognition by 2x using Phase Vocoder. Set it as false to improve the quality of the output.

Set Audio Context Size​

Sets the size of the audio context. Set it as 0 to improve the quality of the output.

Set Temperature To Increase​

Sets the temperature to increase when falling back when the decoding fails to meet either of the thresholds below.

Set Entropy Threshold​

Sets the entropy threshold. If the compression ratio is higher than this value, treat the decoding as failed. Similar to OpenAI's "compression_ratio_threshold"

Set Suppress Blank​

Sets whether to suppress blanks showing up in outputs.

Set Suppress Non Speech Tokens​

Sets whether to suppress non speech tokens showing up in outputs.

Set Beam Size​

Set the number of beams in beam search. Only applicable when temperature is zero.

Set Initial Prompt​

Sets the initial prompt for the first window. This can be used to provide context for the recognition to make it more likely to predict the words correctly, e.g. custom vocabularies or proper nouns.

For more details on effective prompting strategies, see the Whisper Prompting Guide.

Set GPU Acceleration​

Sets whether to use GPU acceleration for speech recognition (only applicable on Windows at the moment).

Set GPU Device ID​

Sets the GPU device ID to use for speech recognition. The default value is 0. This is useful for systems with multiple GPUs to specify which GPU should be used for the recognition process. If the specified GPU device ID is invalid, the first available GPU device index will be used instead.