mutterkey
KDE-first push-to-talk transcription tool for KDE Plasma
Loading...
Searching...
No Matches
WhisperCppTranscriber Class Referencefinal

In-process transcription backend backed by vendored whisper.cpp. More...

#include <whispercpptranscriber.h>

Public Member Functions

 WhisperCppTranscriber (TranscriberConfig config, std::shared_ptr< const TranscriptionModelHandle > model)
 Creates a mutable session from a loaded model handle.
 
 ~WhisperCppTranscriber () override
 Releases the owned whisper.cpp state.
 
 WhisperCppTranscriber (const WhisperCppTranscriber &)=delete
 
WhisperCppTranscriberoperator= (const WhisperCppTranscriber &)=delete
 
 WhisperCppTranscriber (WhisperCppTranscriber &&)=delete
 
WhisperCppTranscriberoperator= (WhisperCppTranscriber &&)=delete
 
QString backendName () const override
 Returns the backend identifier for this live session.
 
bool warmup (RuntimeError *error=nullptr) override
 Eagerly initializes the whisper.cpp context.
 
TranscriptUpdate pushAudioChunk (const AudioChunk &chunk) override
 Appends one normalized chunk to the current utterance buffer.
 
TranscriptUpdate finish () override
 Decodes the buffered utterance and emits final transcript events.
 
TranscriptUpdate cancel () override
 Requests cooperative cancellation of active backend work.
 
- Public Member Functions inherited from TranscriptionSession
 TranscriptionSession (const TranscriptionSession &)=delete
 
TranscriptionSessionoperator= (const TranscriptionSession &)=delete
 
 TranscriptionSession (TranscriptionSession &&)=delete
 
TranscriptionSessionoperator= (TranscriptionSession &&)=delete
 

Static Public Member Functions

static std::shared_ptr< const TranscriptionModelHandleloadModelHandle (const TranscriberConfig &config, RuntimeError *error=nullptr)
 Loads an immutable whisper.cpp model handle.
 
static std::unique_ptr< TranscriptionSessioncreateSession (TranscriberConfig config, std::shared_ptr< const TranscriptionModelHandle > model)
 Creates a mutable session from a generic app-owned model handle.
 
static QString backendNameStatic ()
 Returns the backend name used in diagnostics.
 
static BackendCapabilities capabilitiesStatic ()
 Returns the static capability snapshot for the whisper.cpp runtime.
 
static RuntimeDiagnostics diagnosticsStatic ()
 Returns runtime diagnostics for the embedded whisper runtime.
 

Detailed Description

In-process transcription backend backed by vendored whisper.cpp.

The backend lazily initializes its whisper_context and keeps ownership in a RAII-managed smart pointer so service shutdown and worker teardown stay deterministic.

Definition at line 27 of file whispercpptranscriber.h.

Constructor & Destructor Documentation

◆ WhisperCppTranscriber()

WhisperCppTranscriber::WhisperCppTranscriber ( TranscriberConfig  config,
std::shared_ptr< const TranscriptionModelHandle model 
)

Creates a mutable session from a loaded model handle.

Parameters
configWhisper settings copied into the session.
modelShared immutable model handle.

Member Function Documentation

◆ backendName()

QString WhisperCppTranscriber::backendName ( ) const
overridevirtual

Returns the backend identifier for this live session.

Returns
Short backend name used for logs and diagnostics.

Implements TranscriptionSession.

◆ backendNameStatic()

static QString WhisperCppTranscriber::backendNameStatic ( )
static

Returns the backend name used in diagnostics.

Returns
Human-readable backend identifier.

◆ cancel()

TranscriptUpdate WhisperCppTranscriber::cancel ( )
overridevirtual

Requests cooperative cancellation of active backend work.

Implements TranscriptionSession.

◆ capabilitiesStatic()

static BackendCapabilities WhisperCppTranscriber::capabilitiesStatic ( )
static

Returns the static capability snapshot for the whisper.cpp runtime.

Returns
Capability data derived from the embedded backend integration.

◆ createSession()

static std::unique_ptr< TranscriptionSession > WhisperCppTranscriber::createSession ( TranscriberConfig  config,
std::shared_ptr< const TranscriptionModelHandle model 
)
static

Creates a mutable session from a generic app-owned model handle.

Parameters
configWhisper settings copied into the session.
modelShared immutable model handle.
Returns
Session on success, otherwise nullptr when the model is not a whisper handle.

◆ diagnosticsStatic()

static RuntimeDiagnostics WhisperCppTranscriber::diagnosticsStatic ( )
static

Returns runtime diagnostics for the embedded whisper runtime.

Returns
Runtime/device diagnostic data for this backend.

◆ finish()

TranscriptUpdate WhisperCppTranscriber::finish ( )
overridevirtual

Decodes the buffered utterance and emits final transcript events.

Returns
Structured transcript update for the completed utterance.

Implements TranscriptionSession.

◆ loadModelHandle()

static std::shared_ptr< const TranscriptionModelHandle > WhisperCppTranscriber::loadModelHandle ( const TranscriberConfig config,
RuntimeError error = nullptr 
)
static

Loads an immutable whisper.cpp model handle.

Parameters
configWhisper settings copied into the handle.
errorOptional output for model validation or load failures.
Returns
Shared immutable model handle on success.

◆ pushAudioChunk()

TranscriptUpdate WhisperCppTranscriber::pushAudioChunk ( const AudioChunk chunk)
overridevirtual

Appends one normalized chunk to the current utterance buffer.

Parameters
chunkProduct-owned normalized audio chunk.
Returns
Empty update on success or a structured runtime failure.

Implements TranscriptionSession.

◆ warmup()

bool WhisperCppTranscriber::warmup ( RuntimeError error = nullptr)
overridevirtual

Eagerly initializes the whisper.cpp context.

Parameters
errorOptional output for initialization failures.
Returns
true when the backend is ready for transcription.

Implements TranscriptionSession.


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