TGViewer
C++ - Reddit C++ - Reddit @r_cpp · 230 subscribers
Post #25362 14
speech-core — C++17 on-device voice-agent runtime (VAD + STT + diarization + TTS), dual ONNX / LiteRT backends, Apache 2.0

Open-sourcing a C++17 runtime I've been using for real-time voice agents. The orchestration core is pure C++17 with zero ML dependencies (state machine, VAD-driven turn detection, interruption handling, speech queue with cancel/resume, audio utilities — ring buffer, resampler, mel/STFT). Models sit behind small abstract interfaces (STTInterface, TTSInterface, VADInterface, etc.) so consumers can bring their own backend.

Two reference backends, each independently buildable via a CMake option:
- SPEECHCOREWITHONNX → ONNX Runtime (Silero VAD, Parakeet STT, Kokoro TTS, DeepFilterNet3)
- SPEECH
COREWITHLITERT → LiteRT — libLiteRt from Google's ai-edge-litert PyPI wheel (Silero VAD, Parakeet STT, Nemotron streaming STT, Omnilingual STT, Pyannote diarization, WeSpeaker embeddings, VoxCPM2 TTS)

Both CPU today; an optional CUDA / TensorRT execution provider just landed on the ONNX path (SPEECHCOREWITHCUDA, gated, default off, with build-flag + env (SPEECHCOREORTPROVIDER) + runtime-probe resolution and silent CPU fallback).

Platforms: Linux x8664 + aarch64, Windows x8664, Android. A stable C ABI (speechcorec.h) makes it trivially bindable from Swift / Kotlin / Python — speech-swift is a sibling project that consumes it through a prebuilt XCFramework binary target.

Apache 2.0. Tested on macOS / Linux / Windows in CI; LiteRT runtime is fetched per-platform from the official wheel by a small shell script.

Repo: https://github.com/soniqo/speech-core

Feedback on the interface design / build setup very welcome.

https://redd.it/1tvuifx
@r_cpp
GitHub GitHub - soniqo/speech-core: On-device VAD / streaming STT / TTS / diarization in C++17 (ONNX + LiteRT) with a voice-agent pipeline.… On-device VAD / streaming STT / TTS / diarization in C++17 (ONNX + LiteRT) with a voice-agent pipeline. Linux, Windows, Android. - soniqo/speech-core
More from @r_cpp
  1. Sep 29, 2026Boost.Graph 1.95 will be C++17 Dear Boost.Graph community, In two release cycles (Boost re…
  2. Sep 26, 2026Token Sequence Injection & Modern Macros: The Most Game-Changing Compile-Time Feature in C…
  3. Sep 25, 2026myStringStream.str("") Considered Harmful Under C++20 I was recently looking at some (rath…
  4. Sep 20, 2026A clever branch free optimization I'm the developer of memlz which is an extremely fast co…
  5. Sep 15, 2026Inside Boost.PolyCollection https://bannalia.blogspot.com/2026/09/inside-boostpolycollecti…
  6. Sep 11, 2026C++26: Standard Library Hardening Experiments https://www.cppstories.com/2026/hardening-ex…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →