Crate whisper_rs

Source
Expand description

Most users will be looking for nothing more than WhisperState::full to run a full transcription pipeline.

You can get a WhisperState by first creating a WhisperContext using WhisperContext::new_with_params, and then calling WhisperContext::create_state.

Structs§

DtwParameters
[EXPERIMENTAL] Enable Token-level timestamps with DTW, default Disabled
FullParams
SegmentCallbackData
SystemInfo
Programmatically exposes the information provided by print_system_info
WhisperContext
WhisperContextParameters
WhisperGrammarElement
WhisperSegment
A segment returned by Whisper after running the transcription pipeline.
WhisperState
Rustified pointer to a Whisper state.
WhisperStateSegmentIterator
An iterator over a WhisperState’s result.
WhisperToken
WhisperVadContext
A handle to use whisper.cpp’s built in VAD standalone.
WhisperVadContextParams
Whisper VAD context parameters
WhisperVadParams
Configuration for Voice Activity Detection in whisper.cpp.
WhisperVadSegment
WhisperVadSegments
You can obtain this struct from a WhisperVadContext.

Enums§

DtwMode
DtwModelPreset
GGMLLogLevel
SamplingStrategy
The sampling strategy to use to pick tokens from a list of likely possibilities.
WhisperError
If you have not configured a logging trampoline with [crate::whisper_sys_log::install_whisper_log_trampoline] or [crate::whisper_sys_tracing::install_whisper_tracing_trampoline], then whisper.cpp’s errors will be output to stderr, so you can check there for more information upon receiving a WhisperError.
WhisperGrammarElementType

Statics§

WHISPER_CPP_VERSION
The version of whisper.cpp that whisper-rs was linked with.

Functions§

convert_integer_to_float_audio
Convert an array of 16 bit mono audio samples to a vector of 32 bit floats.
convert_stereo_to_mono_audio
Convert 32-bit floating point stereo PCM audio to 32-bit floating point mono PCM audio.
get_lang_id
Return the id of the specified language, returns -1 if not found
get_lang_max_id
Return the ID of the maximum language (ie the number of languages - 1)
get_lang_str
Get the short string of the specified language id (e.g. 2 -> “de”).
get_lang_str_full
Get the full string of the specified language name (e.g. 2 -> “german”).
install_logging_hooks
Redirect all whisper.cpp and GGML logs to logging hooks installed by whisper-rs.
print_system_info
Print system information.
set_log_callback
Callback to control logging output: default behaviour is to print to stderr.

Type Aliases§

DtwAhead
WhisperAbortCallback
WhisperLogCallback
WhisperLogitsFilterCallback
WhisperNewSegmentCallback
WhisperProgressCallback
WhisperStartEncoderCallback
WhisperSysContext
WhisperSysState
WhisperTokenData
WhisperTokenId