Skip to main content

omni_dev/
voice.rs

1//! Voice capture: microphone-to-WAV pipeline.
2//!
3//! The library half of `omni-dev voice capture`. The CLI entry point lives in
4//! [`crate::cli::voice`]. This module is intentionally CLI-free so the audio
5//! pipeline (source → mixdown → resample → idle-detect → trim → write) can be
6//! unit-tested against fixture WAVs without a real microphone.
7//!
8//! The `AudioSource` trait in [`mod@audio`] is the test seam: production code
9//! uses [`audio::CpalAudioSource`], tests use [`audio::FileAudioSource`].
10//! See [ADR-0031](../../docs/adrs/adr-0031.md) for the rationale.
11
12pub mod audio;
13pub mod backends;
14pub mod capture;
15pub mod clock;
16pub mod det;
17pub mod events;
18pub mod factory;
19pub mod features;
20pub mod idle;
21pub mod models;
22pub mod paths;
23pub mod reconcile;
24pub mod reflect;
25pub mod render;
26pub mod review;
27pub mod session;
28pub mod speaker;
29pub mod transcriber;
30pub mod wav;
31
32pub use audio::{AudioSource, CpalAudioSource, FileAudioSource};
33pub use capture::{
34    install_ctrl_c_handler, run_capture, CaptureOpts, CaptureSummary, TerminationReason,
35};
36pub use clock::{Clock, FixedClock, SystemClock};
37pub use det::{CountingUlidRng, SystemUlidRng, UlidRng};
38pub use factory::{create_default_transcriber, VoiceOpts};
39pub use paths::{captures_dir, omni_dev_voice_root, speaker_file, speakers_dir};
40pub use render::{detect_format, render_jsonl, render_markdown, OutputFormat};
41pub use speaker::{cosine, l2_normalise, EnrolledSpeaker, WespeakerEmbedder, MIN_EMBED_SAMPLES};
42pub use transcriber::{
43    AudioChunk, AudioInput, EndpointKind, EventId, EventStream, SpeakerId, Transcriber,
44    TranscriptEvent, VecAudioInput, Word,
45};