Professional cross-platform audio framework for .NET with zero external dependencies. Native audio engine with optional managed code backends for maximum flexibility.
Two-layer architecture with native C++ engine core and high-level .NET API
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!
Complete audio solution with professional features for production-ready applications. Built on top of Ownaudio.Core, providing simplified APIs for common audio tasks.
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.
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.
Direct integration with operating system audio APIs - no external dependencies required
High-performance C++ audio engine eliminates GC pauses for glitch-free, professional audio. Managed engines also available.
Single codebase works on Windows, macOS, Linux, Android, and iOS with platform-optimized backends.
Native engine ensures deterministic timing without GC interference. Glitch-free audio processing for professional applications.
Built-in decoders for WAV, MP3, and FLAC with automatic format conversion and resampling.
Professional effects including reverb, delay, compressor, 30-band EQ, chorus, and distortion.
Dynamic device enumeration and switching with event-based notifications for device changes.
DAW-style timeline synchronization with sample-accurate precision, start offsets, and automatic drift correction (<10ms tolerance).
Real-time peak and RMS metering, chord detection, and psychoacoustic analysis.
Get started with Ownaudio in minutes
// 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();
// 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();
// 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
Supported Platforms
GC Pauses (Native)
Built-in Effects
Ultra-Low Latency
Comprehensive guides and references to help you get started and master Ownaudio
Get up and running in minutes with our step-by-step guide for both Core and NET APIs.
Read Guide →Complete reference for the low-level Core API with zero-allocation audio engine.
View API Docs →High-level API documentation with mixing, effects, and multi-track support.
View API Docs →Learn from practical examples covering various use cases and scenarios.
Browse Examples →Professional audio mastering with intelligent EQ and psychoacoustic analysis.
Learn More →Advanced musical chord detection with timed analysis and confidence scoring.
Learn More →AI-powered audio separation for splitting music into vocals and instrumental tracks.
Learn More →