Skip to main content

Crate aurum_core

Crate aurum_core 

Source
Expand description

§aurum-core

Reusable on-device speech-to-text library (experimental API).

Aurum converts audio to text using local whisper.cpp models by default, with an optional OpenRouter remote provider.

The API may change without notice until a stable 0.1.0.

§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?;

// Mic host: push PCM, then finalize (no files / ffmpeg).
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;

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.
window
Rolling-window helpers for host-driven “partial-like” decode loops.