audio.cpp  by 0xShug0

Pure C++ audio inference engine for practical local models

Created 2 weeks ago

New!

461 stars

Top 64.9% on SourcePulse

GitHubView on GitHub
Project Summary

audio.cpp provides a high-performance, pure C++ inference engine for modern audio AI models, built on ggml. It targets engineers and researchers seeking to deploy complex audio tasks like TTS, STT, and voice conversion locally without Python dependencies. The core benefit is significantly enhanced speed and reduced latency compared to Python-based solutions, making advanced audio AI practical and efficient.

How It Works

This project utilizes ggml for efficient, low-level tensor operations, enabling a native C++ runtime. This design choice eliminates Python overhead and dependency conflicts, offering a unified framework for diverse audio tasks. Optimized execution paths, reusable sessions, and direct hardware acceleration (CUDA, Vulkan, Metal) are central to its performance advantages, delivering substantial speedups and latency reductions over Python reference implementations.

Quick Start & Requirements

  • Build: Primarily uses CMake. Linux requires GCC 13+; Windows needs Visual Studio Build Tools 2022+ with C++ workload. Backends like CUDA, Vulkan, or Metal can be enabled during configuration. Example Linux build: cmake -S . -B build -DENGINE_ENABLE_CUDA=ON && cmake --build build --parallel --target audiocpp_cli.
  • Prerequisites: Runtime is Python-free. However, the tools/model_manager.py script for downloading models requires Python 3, torch, safetensors, and PyYAML.
  • Model Management: A Python script (tools/model_manager.py) facilitates downloading and managing model packages.
  • Documentation: Detailed usage is available at docs/usage.md.

Highlighted Details

  • Performance: Achieves 1.8x-5.0x faster TTS inference than Python references, with 45%-80% lower latency. VibeVoice 1.5B generates 90 minutes of audio in 22 minutes (~4x real-time).
  • Broad Task Support: Integrates TTS, STT (ASR), VAD, voice conversion, diarization, source separation, music generation, and more within a single framework.
  • Pipeline Workflows: Experimental JSON-based pipelines enable complex, multi-step audio processing and generation tasks.
  • Native Portability: A portable C++ stack with CLI and server entry points allows deployment without Python dependencies.

Maintenance & Community

No specific details regarding maintainers, community channels, sponsorships, or roadmap were found in the provided text.

Licensing & Compatibility

The license type is not explicitly stated in the provided README text.

Limitations & Caveats

GGUF model loading is planned but not yet supported. Streaming inference is not broadly supported across the framework; models should be treated as offline-only. The Metal build script (build_xcframework.sh) is outdated and requires retesting. Quantization may impact output quality and offer minor performance gains, necessitating per-model validation.

Health Check
Last Commit

17 hours ago

Responsiveness

Inactive

Pull Requests (30d)
9
Issues (30d)
27
Star History
460 stars in the last 16 days

Explore Similar Projects

Starred by Dan Guido Dan Guido(Cofounder of Trail of Bits), Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), and
3 more.

voxtral.c by antirez

0.1%
2k
Pure C speech-to-text inference engine for Mistral Voxtral Realtime 4B
Created 5 months ago
Updated 4 months ago
Feedback? Help us improve.