Ownaudio Framework

Professional cross-platform audio framework for .NET with zero external dependencies. Native audio engine with optional managed code backends for maximum flexibility.

Framework Architecture

Two-layer architecture with native C++ engine core and high-level .NET API

The GC Challenge: Why We Moved to Native

The Reality of Managed Audio: Despite our best efforts with pure managed C# code, zero-allocation design, and lock-free structures, the .NET Garbage Collector proved to be an insurmountable challenge for real-time audio. The GC is an inherent part of managed code, and its unpredictable pauses - even brief ones - caused audible glitches and dropouts in audio playback.

The Solution: We introduced a native C++ audio engine that operates completely outside the GC's influence. This native engine is now the default for all platforms, ensuring glitch-free, professional-grade audio performance.

Maximum Flexibility: The managed audio engines remain available in the API for scenarios where GC pauses are acceptable or for development/testing purposes. You have the freedom to choose based on your needs!

OwnaudioNET

High-Level API

Complete audio solution with professional features for production-ready applications. Built on top of Ownaudio.Core, providing simplified APIs for common audio tasks.

15+ Audio Effects
Multi-Track Mixing
Format Support (MP3, WAV, FLAC)
Real-Time Processing
Chord Detection
Audio Matchering
Recording & Streaming
Native Engine

C++ Audio Core DEFAULT

High-performance native C++ engine that eliminates GC interference. After extensive testing with managed code, we found that the .NET Garbage Collector inevitably causes audio glitches. The native engine provides deterministic, glitch-free audio processing by operating outside the GC's control.

No GC Pauses
Deterministic Timing
Ultra-Low Latency
Professional Quality
All Platforms
Default Engine
Ownaudio.Core

Managed Audio Engines OPTIONAL

Pure managed C# implementations remain available for scenarios where GC pauses are acceptable or for development/testing. While we achieved zero-allocation design and lock-free structures, the GC remains an unavoidable part of managed code that can impact real-time audio.

Pure C# Code
Easy Debugging
Platform Integration
Built-in Decoders
Device Management
Format Conversion

Native Platform Support

Direct integration with operating system audio APIs - no external dependencies required

Windows
WASAPI
macOS
Core Audio
Linux
PulseAudio
iOS
Core Audio
Android
AAudio

Powerful Features

Native Engine Core

High-performance C++ audio engine eliminates GC pauses for glitch-free, professional audio. Managed engines also available.

Cross-Platform

Single codebase works on Windows, macOS, Linux, Android, and iOS with platform-optimized backends.

Deterministic Real-Time

Native engine ensures deterministic timing without GC interference. Glitch-free audio processing for professional applications.

Format Support

Built-in decoders for WAV, MP3, and FLAC with automatic format conversion and resampling.

Audio Effects

Professional effects including reverb, delay, compressor, 30-band EQ, chorus, and distortion.

Device Management

Dynamic device enumeration and switching with event-based notifications for device changes.

Master Clock Sync

DAW-style timeline synchronization with sample-accurate precision, start offsets, and automatic drift correction (<10ms tolerance).

Audio Analysis

Real-time peak and RMS metering, chord detection, and psychoacoustic analysis.

Quick Start Examples

Get started with Ownaudio in minutes

NativeEngineExample.cs
// Create NATIVE audio engine (DEFAULT - GC-free!)
using var engine = AudioEngineFactory.CreateDefault();
// Or explicitly request native engine:
// using var engine = AudioEngineFactory.CreateNative();

// Configure and start the engine
var config = new AudioConfig
{
    SampleRate = 48000,
    Channels = 2,
    BufferSize = 512
};
engine.Initialize(config);
engine.Start();

// Create decoder for audio file
using var decoder = AudioDecoderFactory.Create("music.mp3",
    targetSampleRate: 48000,
    targetChannels: 2);

// Decode and send audio frames
// Use the new, efficient zero-allocation pattern
var buffer = new byte[config.BufferSize * config.Channels * sizeof(float)];
while (true)
{
    var result = decoder.ReadFrames(buffer);
    if (result.IsEOF) break;

    var samples = System.Runtime.InteropServices.MemoryMarshal.Cast(buffer.AsSpan(0, result.FramesRead * config.Channels * sizeof(float)));
    engine.Send(samples);
}

engine.Stop();
ManagedEngineExample.cs
// Create MANAGED audio engine (OPTIONAL - pure C#)
// Note: Managed engines may experience GC-related glitches
using var engine = AudioEngineFactory.CreateManaged();

// Or create platform-specific managed engine:
#if WINDOWS
    using var engine = new WasapiEngine();
#elif LINUX
    using var engine = new PulseAudioEngine();
#elif MACOS
    using var engine = new CoreAudioEngine();
#endif

// Rest of the code is the same
var config = new AudioConfig { SampleRate = 48000, Channels = 2 };
engine.Initialize(config);
engine.Start();

using var decoder = AudioDecoderFactory.Create("music.mp3",
    targetSampleRate: 48000,
    targetChannels: 2);

// Use the new, efficient zero-allocation pattern
var buffer = new byte[config.BufferSize * config.Channels * sizeof(float)];
while (true)
{
    var result = decoder.ReadFrames(buffer);
    if (result.IsEOF) break;

    var samples = System.Runtime.InteropServices.MemoryMarshal.Cast(buffer.AsSpan(0, result.FramesRead * config.Channels * sizeof(float)));
    engine.Send(samples);
}

engine.Stop();
NetExample.cs (UI Apps - Async)
// Initialize OwnaudioNET (async for UI apps!)
await OwnaudioNet.InitializeAsync();

// Create file source
var source = new FileSource("music.mp3");

// Create mixer and add source
var mixer = new AudioMixer(OwnaudioNet.Engine);
mixer.AddSource(source);
mixer.Start();

// Play the source
source.Play();

// Apply professional effects
var reverb = new ReverbEffect { Mix = 0.3f, RoomSize = 0.7f };
var compressor = new CompressorEffect(threshold: 0.5f, ratio: 4.0f, sampleRate: 48000f);
var sourceWithEffects = new SourceWithEffects(source, reverb, compressor);

// Control playback
source.Volume = 0.8f;
source.Seek(30.0); // seconds

5+

Supported Platforms

Zero

GC Pauses (Native)

15+

Built-in Effects

<5ms

Ultra-Low Latency

Documentation

Comprehensive guides and references to help you get started and master Ownaudio

Quick Start

Get up and running in minutes with our step-by-step guide for both Core and NET APIs.

Read Guide →

Core API Reference

Complete reference for the low-level Core API with zero-allocation audio engine.

View API Docs →

NET API Reference

High-level API documentation with mixing, effects, and multi-track support.

View API Docs →

Code Examples

Learn from practical examples covering various use cases and scenarios.

Browse Examples →

Audio Matchering

Professional audio mastering with intelligent EQ and psychoacoustic analysis.

Learn More →

Chord Detection

Advanced musical chord detection with timed analysis and confidence scoring.

Learn More →

Vocal Remover

AI-powered audio separation for splitting music into vocals and instrumental tracks.

Learn More →