Expand description
§aurum-core
Reusable on-device speech I/O library (experimental API).
- STT — local whisper.cpp by default; optional OpenRouter
- TTS — local ONNX KittenTTS (cargo feature
tts, default on) - Cleanup — rules or optional LLM post-edit
Tagline: Speech both ways. On-device by default.
The API may change without notice until a stable 0.1.0.
§STT example
use aurum_core::audio::{AudioInput, WHISPER_SAMPLE_RATE};
use aurum_core::pcm::PcmBuffer;
use aurum_core::providers::{LocalWhisperProvider, TranscriptionOptions};
use std::path::PathBuf;
let provider = LocalWhisperProvider::new(PathBuf::from("/tmp/aurum-cache"))
.with_progress(false)
.with_local_only(false);
provider.preload("tiny-q5_1").await?;
let mut buf = PcmBuffer::dictation();
buf.push(&[0.0f32; 1600])?;
let result = provider
.transcribe_pcm(
buf.samples(),
&TranscriptionOptions {
model: "tiny-q5_1".into(),
language: "en".into(),
timestamps: false,
cancel: None,
},
)
.await?;
let _ = AudioInput::from_pcm_slice(buf.samples(), WHISPER_SAMPLE_RATE)?;
println!("{}", result.text);
aurum_core::providers::local::clear_context_cache();Re-exports§
pub use audio::load_audio;pub use audio::AudioInput;pub use audio::WHISPER_SAMPLE_RATE;pub use cancel::CancelFlag;pub use cleanup::apply_cleanup;pub use cleanup::apply_cleanup_with_segments;pub use cleanup::cleanup_text;pub use cleanup::CleanupProviderKind;pub use cleanup::CleanupResult;pub use cleanup::CleanupStyle;pub use cleanup::OpenRouterCleanup;pub use cleanup::RulesCleanup;pub use cleanup::SegmentCleanupPolicy;pub use cleanup::TextCleanup;pub use config::Config;pub use error::Result;pub use error::TranscriptionError;pub use model::list_models;pub use model::DownloadProgress;pub use model::EnsureModelOptions;pub use model::ModelInfo;pub use model::ModelStatus;pub use output::format_result;pub use output::OutputFormat;pub use pcm::PcmBuffer;pub use providers::LocalWhisperProvider;pub use providers::OpenRouterProvider;pub use providers::Segment;pub use providers::TranscriptionOptions;pub use providers::TranscriptionProvider;pub use providers::TranscriptionResult;pub use window::PartialClock;pub use window::PartialWindowPolicy;pub use tts::format_model_list as format_tts_model_list;pub use tts::format_voice_list as format_tts_voice_list;pub use tts::list_models as list_tts_models;pub use tts::list_voices as list_tts_voices;pub use tts::write_wav_i16_mono_atomic;pub use tts::BackendKind as TtsBackendKind;pub use tts::LocalTtsProvider;pub use tts::SynthesisOptions;pub use tts::SynthesisProvider;pub use tts::SynthesisResult;pub use tts::DEFAULT_TTS_MODEL;pub use tts::DEFAULT_TTS_VOICE;
Modules§
- audio
- Audio loading and conversion.
- cancel
- Cooperative cancellation for long-running local transcription.
- cleanup
- Post-transcription text cleanup ( “flow”).
- config
- Configuration loading for Aurum.
- error
- Error taxonomy for Aurum.
- model
- Local whisper.cpp model management: resolve, download, cache, list.
- output
- Output formatters: txt, srt, json.
- pcm
- In-memory PCM buffer for mic / streaming hosts (no files, no ffmpeg).
- postprocess
- Shared transcript cleanup applied after every provider.
- providers
- Transcription provider abstraction.
- tts
- Local text-to-speech (TTS) — ONNX KittenTTS + MIT G2P.
- window
- Rolling-window helpers for host-driven “partial-like” decode loops.