pub struct Config {
pub models_dir: Option<PathBuf>,
pub asr_model: ModelSpec,
pub normalizer: Option<ModelSpec>,
pub normalize_options: NormalizeOptions,
pub language: Option<String>,
pub max_capture: Duration,
pub silence_floor: f32,
pub diagnostics_dir: Option<PathBuf>,
pub digest_cache_dir: Option<PathBuf>,
}Expand description
Configuration for one dictation engine.
Construct via ConfigBuilder rather than populating directly.
Values are validated where they are used, never here: an unreadable
models directory surfaces from crate::prepare, not from
ConfigBuilder::build.
Fields§
§models_dir: Option<PathBuf>Directory holding model files. None resolves to a subdirectory of the platform cache directory.
asr_model: ModelSpecSpeech recognition model.
normalizer: Option<ModelSpec>Model that rewrites raw recognition output into clean text. None leaves the recognition output as-is and fetches nothing for it.
When set, the engine loads it beside the recognition model and
rewrites every transcript: crate::Transcript::text carries the
result and asr the recognised text it came from. When None
the two are equal, which is a supported configuration rather than
a degraded one.
normalize_options: NormalizeOptionsHow the normalizer rewrites text, when one is configured.
styling is the axis a person picks per recording; k and
ngram are decoder tuning and do not belong in a user-facing
picker beside it. Overridable per call via
crate::Engine::transcribe_with, so this is the default rather
than a fixed choice.
language: Option<String>Spoken language hint. None autodetects.
max_capture: DurationUpper bound on a single capture. A capture nobody stops ends itself here rather than holding the input device indefinitely.
Costs memory eagerly: the whole cap is reserved when recording starts, at 4 bytes a sample, so the 30 min default reserves about 110 MiB and an hour reserves 219 MiB, whatever the utterance turns out to be. Reserved rather than grown because the audio callback must not allocate. Clamped to an hour.
silence_floor: f32Peak input level, in dBFS, below which a capture counts as silence rather than as an empty transcript.
diagnostics_dir: Option<PathBuf>Directory the crate writes per-take diagnostics into: the
capture audio and every transcription stage, best-effort, under
crate::diagnostics. None writes nothing - diagnostics are
the host’s choice of directory, never a requirement.
digest_cache_dir: Option<PathBuf>Directory the crate records verified model digests in, keyed on each file’s size and modification time, so a file unchanged since it was last verified is not read end to end again.
None disables the cache and hashes every time: a caller with no
machine-local directory of its own to put it in keeps the old
cost rather than having one invented for it.