OwnAudioSharp is a professional cross-platform audio framework featuring a native C++ audio engine for glitch-free, real-time audio processing. After extensive development with pure managed code, we discovered that the .NET Garbage Collector is insurmountable for professional real-time audio - the native engine is now the default, with managed C# implementations available for development and testing.
Native Engine (Default): GC-free C++ audio core eliminates glitches and provides deterministic real-time performance Managed Engines (Optional): Pure C# implementations available for development, testing, and debugging Professional Audio Features: AI-driven vocal separation, audio mastering, advanced chord detection Commercial Quality, Free: Professional tools without licensing costs Truly Cross-Platform: Windows, macOS, Linux, Android, iOS
OwnAudioSharp v2.4.0 introduces MasterClock, a professional timeline-based synchronization system replacing the legacy GhostTrack architecture. MasterClock provides sample-accurate synchronization with automatic drift correction, dropout event monitoring, DAW-style timeline regions, and global tempo control. The legacy GhostTrack/AudioSynchronizer system is deprecated and will be removed in v3.0.0. See the MultitrackPlayer example for a complete implementation with real-time dropout monitoring and professional synchronization.
OwnAudioSharp v2.5.0 introduces SmartMaster is a comprehensive master processing chain that combines professional-grade effects with intelligent auto-calibration for optimal sound across different speaker systems.
β Factory Presets - Pre-configured settings for different playback systems:
- Default - Transparent passthrough (no processing)
- HiFi - Bookshelf/tower speakers with gentle bass enhancement
- Headphone - Balanced response for studio/consumer headphones
- Studio - Professional monitors with flat, accurate response
- Club - DJ/club systems with heavy bass and presence boost
- Concert - Medium PA systems with compensated frequency response
β Auto-Calibration Wizard - Intelligent measurement system:
- Requires measurement microphone (external hardware needed for calibration)
- Automatic speaker detection and analysis
- Frequency response measurement with FFT analysis
- Phase alignment detection
- Time-of-arrival (TOA) measurement
- Automatic EQ correction based on measurements
- Note: Without a measurement microphone, only factory presets are available
β Professional Processing Chain:
- 31-Band Graphic EQ - Precise frequency shaping
- Subharmonic Synthesizer - Enhanced low-frequency extension
- Multiband Compressor - Dynamic range control
- Crossover Filter - Linkwitz-Riley 4th order (configurable frequency)
- Phase & Time Alignment - Delay compensation for multi-way systems
- Brick-Wall Limiter - Peak protection and loudness maximization
β Custom Preset Management:
- Save your calibrated settings
- Load and share custom presets
- Reset to factory defaults anytime
SmartMaster is fully integrated into the MultitrackPlayer example application!
# Run the MultitrackPlayer example
cd OwnAudio/Examples/Ownaudio.Example.MultitrackPlayer
dotnet runThe MultitrackPlayer UI includes:
- Enable/Disable Toggle - Turn SmartMaster on/off in real-time
- Factory Preset Selection - Choose from 6 speaker-specific presets
- Auto Calibration - Run the measurement wizard with progress tracking
- Custom Presets - Save and load your own configurations
using OwnaudioNET.Effects.SmartMaster;
// Initialize SmartMaster
var smartMaster = new SmartMasterEffect();
smartMaster.Initialize(engine.Config);
// Option 1: Use factory preset
smartMaster.LoadSpeakerPreset(SpeakerType.HiFi);
smartMaster.Enabled = true;
// Option 2: Run auto-calibration
await smartMaster.StartMeasurementAsync();
// Measurement wizard guides through speaker detection and analysis
// Option 3: Load custom preset
smartMaster.Load("my_custom_setup");
// Apply to mixer output
mixer.AddMasterEffect(smartMaster);| Preset | Use Case | Bass | Mids | Highs | Crossover | Compression |
|---|---|---|---|---|---|---|
| Default | Reference | Flat | Flat | Flat | None | Off |
| HiFi | Home stereo | +1.5dB | Flat | +1.0dB | 40Hz | Light |
| Headphone | Personal listening | +0.5dB | Flat | -1.0dB | None | Gentle |
| Studio | Production | +0.3dB | Flat | Flat | 35Hz | Minimal |
| Club | DJ/Dance | +4.0dB | Flat | +2.5dB | 100Hz | Moderate |
| Concert | Live PA | +3.0dB | -0.8dB | +2.0dB | 80Hz | Moderate |
Subharmonic Synthesis: Generates harmonically-related low frequencies below the speaker's natural cutoff, enhancing bass response on smaller systems.
Phase Alignment: Automatically compensates for time-of-arrival differences between drivers in multi-way speaker systems, ensuring coherent sound.
Adaptive Crossover: Linkwitz-Riley 4th order filters provide perfect reconstruction when summed, maintaining phase coherence across the crossover region.
Measurement Engine: Uses white noise test signals and FFT analysis to measure actual speaker response, then calculates optimal EQ correction automatically.
See the SmartMaster in MultitrackPlayer for a complete working example with full UI integration!
π Detailed Documentation: For comprehensive information about SmartMaster including all parameters, technical details, and advanced usage examples, see the Effects Documentation.
Version 2.1.0+ (Current) - Native engine with PortAudio/miniaudio backends
Version 2.0.0 - Attempted pure managed code (GC issues discovered)
Pre-2.0.0 - Native libraries (miniaudio, portaudio, ffmpeg)
Features you typically only find in commercial software:
-
AI Vocal Separation: State-of-the-art vocal and instrumental track separation using ONNX neural networks
- Multiple quality models:
default,best,karaoke - Professional-grade stem isolation
- Multiple quality models:
-
Audio Mastering: AI-driven matchering - master your tracks to match reference audio
- Automatic EQ matching and spectral analysis
- Professional mastering without expensive plugins
-
Advanced Chord Detection: Musical chord recognition from simple to professional
- Real-time and offline analysis
- Major, minor, diminished, augmented, extended chords (7th, 9th, 11th, 13th)
- Chromagram-based recognition
-
Native C++ Audio Engine (Default):
- GC-free, deterministic real-time audio processing
- PortAudio backend (if installed) or embedded miniaudio fallback
- Professional-grade performance on all platforms
- Zero audio glitches or dropouts
-
Managed C# Engines (Optional):
- Windows (WASAPI), macOS (Core Audio), Linux (PulseAudio), Android (AAudio)
- Pure C# implementation for development and debugging
- Available but may experience GC-related glitches
-
Dual API Layers:
- Low-level Core API for direct engine control
- High-level NET API for professional features
-
Audio Processing:
- Multi-format support (MP3, WAV, FLAC) with built-in decoders
- Real-time effects: reverb, compressor, equalizer, pitch shifting, tempo control
- Multi-source audio mixing with synchronized playback
-
High Performance:
- Native engine: Zero GC interference
- Lock-free ring buffers for thread safety
- SIMD-optimized audio processing
Install-Package OwnAudioSharpdotnet add package OwnAudioSharp- .NET 8.0 or later
- Optional: PortAudio library for best performance (automatically falls back to embedded miniaudio if not available)
The native engine includes:
- PortAudio (preferred) - Install separately for best performance
- miniaudio (fallback) - Embedded as resource, always available
- No installation required - works out of the box with miniaudio
Complete API documentation with examples is available on the official website:
The website includes:
- Complete API reference for all classes and methods
- Step-by-step tutorials and usage examples
- Architecture and design documentation
- Best practices and performance tips
- Professional feature guides (vocal removal, mastering, chord detection)
OwnAudioSharp's audio engine is built on a modular architecture with platform-specific implementations. Detailed documentation is available for each component:
- Ownaudio.Core - Cross-platform interfaces, audio decoders (MP3/WAV/FLAC), lock-free buffers, and zero-allocation primitives
- Ownaudio.Windows - WASAPI implementation for Windows (10+)
- Ownaudio.Linux - PulseAudio implementation for Linux
- Ownaudio.macOS - Core Audio implementation for macOS
- Ownaudio.Android - AAudio implementation for Android (API 26+)
Each platform implementation includes:
- Architecture overview and native API details
- Performance characteristics and latency information
- Platform-specific requirements and dependencies
- Usage examples and best practices
- Troubleshooting guides
For low-level engine development or platform-specific optimization, check out the individual platform documentation.
using Ownaudio.Core;
// Create NATIVE audio engine (DEFAULT - GC-free!)
// Automatically uses PortAudio if available, otherwise miniaudio
using var engine = AudioEngineFactory.CreateDefault();
// Configure and start the engine
var config = new AudioConfig
{
SampleRate = 48000,
Channels = 2,
BufferSize = 512
};
engine.Initialize(config);
engine.Start();
// Create decoder and play audio
using var decoder = AudioDecoderFactory.Create("music.mp3",
targetSampleRate: 48000,
targetChannels: 2);
while (true)
{
var result = decoder.DecodeNextFrame();
if (result.IsEOF) break;
// Native engine - no GC glitches!
engine.Send(result.Frame.Samples);
}
engine.Stop();// Initialize OwnaudioNET (uses native engine by default)
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// Create MANAGED audio engine (pure C#)
// Note: May experience GC-related audio glitches
using var engine = AudioEngineFactory.CreateManaged();
// Or platform-specific:
#if WINDOWS
using var engine = new WasapiEngine();
#elif LINUX
using var engine = new PulseAudioEngine();
#elif MACOS
using var engine = new CoreAudioEngine();
#endif
engine.Initialize(AudioConfig.Default);
engine.Start();
// ... rest of your codeOwnAudioSharp is completely free and open-source, providing professional-grade audio features without licensing costs. If you find this library useful, especially for commercial purposes, consider supporting its continued development:
Why support?
- Enables continued development and new features
- Ensures timely bug fixes and updates
- Improves documentation and examples
- Saves you thousands in commercial audio library licensing costs
Your support helps keep professional audio technology accessible to everyone!
See the LICENSE file for details.
Special thanks to the creators of:
- DryWetMidi - .NET library to work with MIDI data and MIDI devices
- soundtouch.net - .NET wrapper for SoundTouch
- Avalonia - Cross-platform .NET UI framework
