Skip to content

ModernMube/OwnAudioSharp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

969 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OwnAudio

A new kind of audio API for .NET

OwnAudioSharp is a professional-grade, cross-platform audio API for C# — with something no other .NET audio library has: from the first sample to the last byte, your audio is processed by a purpose-built Rust engine. You write 100% C#; Rust does the heavy lifting.

The entire audio path — decoding, mixing, effects, resampling, playback and capture — runs in a native Rust core that was written specifically for this package. On top of it sits a clean, idiomatic C# surface. The result: low CPU usage and a small memory footprint — engineered to industry standards for professional, production-ready use.

  • 🦀 Rust engine, C# surface — native performance with a managed developer experience.
  • 🎯 Rock-solid real-time path — no dropouts, no glitches.
  • 📦 Zero external dependencies — one NuGet package, native code bundled and built for it.
  • Low CPU & memory — real-time headroom on desktop and mobile alike.
  • 🌍 Truly cross-platform — Windows, macOS, Linux, Android and iOS from a single API.

Nothing like it exists for C# today.

Decoding is pure Rust too — no external codecs, no FFmpeg, no system dependencies. The built-in decoder handles MP3, FLAC, WAV (PCM/ADPCM), AAC, MP4/M4A, OGG/Vorbis and AIFF out of the box, on every platform.


What you get

Category Capability
Playback & Mixing Multi-track sync, real-time tempo/pitch, per-track volume
Recording Low-latency capture with device selection
Effects 15 real-time DSP effects (reverb, EQ, compressor, limiter, …)
Plugins VST3 effect plugins with cross-platform editor GUI
MIDI Hardware I/O, SMF file read/write, hardware-accurate clock
Network Sample-accurate multi-device sync over LAN
Mastering Reference-based mastering (Audio Matchering)
Analysis Real-time chord detection
Calibration SmartMaster speaker calibration with automatic EQ correction

Recommended for: music players and DAWs, DJ software, music-education tools, broadcast and podcast pipelines, live-performance apps, and low-latency game audio.


Installation

dotnet add package OwnAudioSharp          # Desktop — everything
dotnet add package OwnAudioSharp.Mobile   # Android / iOS
dotnet add package OwnAudioSharp.Basic    # Desktop — minimal engine
Package Platforms What it is
OwnAudioSharp Windows, Linux, macOS The complete edition. Playback, recording, mixing, effects, VST3 and MIDI, plus the analysis features (chord detection, note transcription, matchering) and the waveform display.
OwnAudioSharp.Mobile Android, iOS The same feature set built for mobile, including matchering and the waveform display — minus the ONNX-based analysis (no chord detection, no note transcription).
OwnAudioSharp.Basic Windows, Linux, macOS Audio in and out, and nothing that could be left out. Playback, recording, mixing, effects and VST3 — no analysis features, no ONNX models, no UI dependency.

Requirement: .NET 10.0 or later. The native Rust engine — including the audio decoder — is bundled in the package. There is nothing else to install and no external codecs to configure.


Features

Multi-Track Synchronized Playback

Play multiple audio files in perfect sync using a shared central clock. Each track has independent volume, pitch and tempo control — ideal for DAW-style apps or multitrack players.

Real-Time Tempo & Pitch

Adjust playback speed and pitch independently, in real time, across multiple tracks simultaneously.

15 Real-Time DSP Effects

Reverb, equalizer, compressor, limiter, chorus, delay, distortion and more — freely combinable, inserted per-track or on the master bus.

VST3 Plugin Support

Load VST3 effect plugins and use their native cross-platform editor GUI, integrated into the effect chain like any built-in effect.

Full guide: OwnAudio/Source/Effects/VST/README.md

Simple Recording & Playback

Straightforward capture from any input device with configurable sample rate, buffer size and channel count.

SmartMaster — Automatic Speaker Calibration

Measures your speakers with a microphone and corrects the output automatically. Includes speaker profiles (HiFi, Headphone, Studio, Club, Concert), a 31-band EQ, multiband compression and a brick-wall limiter.

Full guide: OwnAudio/Source/Effects/SmartMaster/README.md

NetworkSync — Multi-Device Synchronization

Synchronizes playback across devices on the local network with sample-accurate precision (< 5 ms on LAN). Zero-configuration with automatic server discovery.

Audio Matchering — Reference-Based Mastering

Analyzes a reference track and applies its spectral and dynamic characteristics to your audio for professional mastering results.

Full guide: OwnAudio/Source/Features/Matchering/README.md

Chord Detection — Real-Time Musical Analysis

Recognizes major, minor, diminished, augmented and extended chords (7th–13th) from audio in real time or offline, using a chromagram-based pipeline.

Full guide: OwnAudio/Source/Features/ChorDetect/README.md

MIDI — Hardware I/O, Files, and Clock

Full API reference: OwnAudio/Midi/README.md

AOT-compatible, reflection-free MIDI on Windows (WinMM), macOS (CoreMIDI) and Linux (ALSA rawmidi): real-time input/output, Standard MIDI File (format 0/1) read/write/edit, and a hardware-accurate 24 PPQN clock.


The road to 4.0

Getting to a truly dependable real-time audio API took four generations — each one solved a problem the last one exposed:

Version Approach What it taught us
1.0 MiniAudio + PortAudio + FFmpeg, no optimization Proved the core idea and shaped the API — but left performance on the table.
2.0 Fully managed, cross-platform engine, zero native dependencies Clean and portable, but managed code alone could not deliver the consistency the real-time audio path demands.
3.0 Optimized native engines (MiniAudio + PortAudio + FFmpeg); mixing, effects and sync in managed code Fast — but the managed processing stage could still be stalled by the host application under load.
4.0 The entire audio chain runs in native Rust; the whole API is wrapped in a thin managed layer A C# audio API whose real-time path is completely independent of the host application — professional, industry-standard behavior for real-world .NET audio apps.

4.0 is the payoff: no matter what the surrounding C# code does, the audio never stutters — because not a single sample is processed in managed code.


Architecture

OwnAudioSharp is a thin C# surface over a native Rust engine:

Application
  └─ OwnaudioNet (high-level C# API)
       └─ AudioEngineWrapper (lock-free, non-blocking)
            └─ Native Rust engine (ownaudio-ffi + ownaudio-core)
                 └─ Audio hardware
  • Ownaudio.Core — platform-agnostic interfaces, lock-free ring buffers, SIMD converters and object pools.
  • OwnAudioRust — the C# binding stack over the Rust core, in three layers: HighLevelSafeNative.
  • Native Rust engineownaudio-ffi (the C ABI boundary) wrapping ownaudio-core (decoding, mixing, effects, resampling, playback and capture).

All blocking engine methods (Initialize, Stop, Send) must be called off the UI thread. The high-level OwnaudioNet API handles threading internally.


Documentation

Complete API reference, tutorials and guides are on the official website:

Working example projects live in OwnAudio/Examples/.


Support

OwnAudioSharp is free and open-source. If it saves you time or ships in your product, consider supporting its development:

Issues and feature requests: GitHub Issues


License

See the LICENSE file for details.


Development Tools

This project is developed with the following tools:

Claude Code Anthropic — Claude Code
Visual Studio Code Microsoft — Visual Studio Code
Visual Studio 2022 Microsoft — Visual Studio 2022
Rider JetBrains — Rider