mutterkey
KDE-first push-to-talk transcription tool for KDE Plasma
Loading...
Searching...
No Matches
cpureferencetranscriber.h
Go to the documentation of this file.
1#pragma once
2
3#include "config.h"
8
9#include <memory>
10
24{
25public:
32 [[nodiscard]] static std::shared_ptr<const TranscriptionModelHandle>
33 loadModelHandle(const TranscriberConfig &config, RuntimeError *error = nullptr);
34
41 [[nodiscard]] static std::unique_ptr<TranscriptionSession>
42 createSession(TranscriberConfig config, std::shared_ptr<const TranscriptionModelHandle> model);
43
49 CpuReferenceTranscriber(TranscriberConfig config, std::shared_ptr<const TranscriptionModelHandle> model);
50
51 ~CpuReferenceTranscriber() override;
52
54 CpuReferenceTranscriber &operator=(const CpuReferenceTranscriber &) = delete;
57
62 [[nodiscard]] static QString backendNameStatic();
63
69
74 [[nodiscard]] static RuntimeDiagnostics diagnosticsStatic();
75
76 [[nodiscard]] QString backendName() const override;
77 bool warmup(RuntimeError *error = nullptr) override;
78 [[nodiscard]] TranscriptUpdate pushAudioChunk(const AudioChunk &chunk) override;
79 [[nodiscard]] TranscriptUpdate finish() override;
80 [[nodiscard]] TranscriptUpdate cancel() override;
81
82private:
83 TranscriberConfig m_config;
84 std::shared_ptr<const CpuReferenceModelHandle> m_model;
85 std::vector<float> m_bufferedSamples;
86 bool m_warmedUp = false;
87 bool m_cancelRequested = false;
88};
89
95[[nodiscard]] std::shared_ptr<const TranscriptionEngine> createCpuReferenceTranscriptionEngine(const TranscriberConfig &config);
In-process native CPU transcription backend used as the product-owned reference runtime.
TranscriptUpdate pushAudioChunk(const AudioChunk &chunk) override
Ingests one normalized audio chunk into the live session.
static std::shared_ptr< const TranscriptionModelHandle > loadModelHandle(const TranscriberConfig &config, RuntimeError *error=nullptr)
Loads an immutable native CPU model handle from a validated package.
static std::unique_ptr< TranscriptionSession > createSession(TranscriberConfig config, std::shared_ptr< const TranscriptionModelHandle > model)
Creates a mutable session from a generic app-owned model handle.
TranscriptUpdate cancel() override
Requests cooperative cancellation of any active decode.
CpuReferenceTranscriber(TranscriberConfig config, std::shared_ptr< const TranscriptionModelHandle > model)
Creates a mutable native CPU session from a loaded model handle.
static BackendCapabilities capabilitiesStatic()
Returns static capability metadata for the native CPU runtime.
QString backendName() const override
Returns the backend identifier for this live session.
bool warmup(RuntimeError *error=nullptr) override
Performs optional backend warmup for this session.
static RuntimeDiagnostics diagnosticsStatic()
Returns static runtime diagnostics for the native CPU runtime.
TranscriptUpdate finish() override
Flushes the current utterance and emits any final transcript events.
static QString backendNameStatic()
Returns the stable backend identifier used in diagnostics.
Mutable per-session transcription interface.
Runtime configuration types, defaults, and JSON loading entrypoints.
Native CPU reference model format definitions and loading helpers.
std::shared_ptr< const TranscriptionEngine > createCpuReferenceTranscriptionEngine(const TranscriberConfig &config)
Creates the product-owned CPU reference engine implementation.
Product-owned model package manifest and validated package value types.
One normalized streaming audio unit passed into a transcription session.
Product-owned backend/runtime metadata surfaced to app code.
Runtime inspection data kept separate from static backend capabilities.
Structured runtime-layer failure with user-facing and diagnostic text.
Transcription runtime configuration.
Definition config.h:62
Result of one streaming session operation.
Stable engine/session boundary for embedded transcription backends.
Shared value types exchanged by the transcription pipeline.