Quick Start
Get OwnAudioSharp running in your .NET project in minutes.
Installation
Choose the package that fits your use case:
| Package | Size | Platforms | Includes AI/ML |
|---|---|---|---|
OwnAudioSharp | ~290 MB | Windows, Linux, macOS | ✅ Vocal removal, chords, matchering |
OwnAudioSharp.Basic | <5 MB | + Android, iOS | ❌ Core audio only |
OwnAudioSharp.Midi | <1 MB | Windows, Linux, macOS | — MIDI standalone |
Shell
dotnet add package OwnAudioSharp
# lightweight (no AI/ML):
dotnet add package OwnAudioSharp.BasicArchitecture
OwnAudioSharp uses a two-layer design that keeps the real-time audio thread completely separate from your application code.
Thread diagram
UI / Main Thread
└─> OwnaudioNet.Send() [lock-free ring buffer, <0.1ms]
└─> AudioEngineWrapper
└─> Pump Thread [dedicated background thread]
└─> Audio RT Thread [WASAPI / CoreAudio / PulseAudio / Oboe]Never call blocking engine methods from the UI thread. Use InitializeAsync(), StopAsync(), and ShutdownAsync() in all UI applications (WPF, WinForms, MAUI, Avalonia).
Basic Playback
The minimal setup to play an audio file:
C#
using OwnaudioNET;
using OwnaudioNET.Mixing;
using OwnaudioNET.Sources;
// 1. Initialize (async is required in UI apps)
await OwnaudioNet.InitializeAsync();
OwnaudioNet.Start();
// 2. Create the mixer
var mixer = new AudioMixer(OwnaudioNet.Engine!.UnderlyingEngine);
mixer.Start();
// 3. Load and play
var track = new FileSource("song.mp3");
mixer.AddSource(track);
// 4. Cleanup on app exit
mixer.Dispose();
await OwnaudioNet.ShutdownAsync();Custom Configuration
C#
// Select WASAPI on Windows, use low latency
var config = new AudioConfig
{
SampleRate = 48000,
Channels = 2,
BufferSize = 256, // ~5.3ms latency
HostType = OperatingSystem.IsWindows()
? EngineHostType.WASAPI
: EngineHostType.None,
EnableInput = false,
EnableOutput = true
};
await OwnaudioNet.InitializeAsync(config);
OwnaudioNet.Start();Multi-Track with Sync
C#
var mixer = new AudioMixer(OwnaudioNet.Engine!.UnderlyingEngine, bufferSizeInFrames: 1024);
mixer.Start();
// Load tracks
var sr = OwnaudioNet.Engine!.Config.SampleRate;
var ch = OwnaudioNet.Engine!.Config.Channels;
var vocals = new FileSource("vocals.wav", targetSampleRate: sr, targetChannels: ch);
var backing = new FileSource("backing.mp3", targetSampleRate: sr, targetChannels: ch);
// Attach to master clock for sample-accurate sync
vocals.AttachToClock(mixer.MasterClock);
backing.AttachToClock(mixer.MasterClock);
// Set volumes
vocals.Volume = 0.9f;
backing.Volume = 0.8f;
// Seek and play
vocals.Seek(0);
backing.Seek(0);
vocals.Play();
backing.Play();
mixer.AddSource(vocals);
mixer.AddSource(backing);Add Effects
C#
using OwnaudioNET.Effects;
using OwnaudioNET.Sources;
// Per-track effect
var source = new FileSource("guitar.wav");
var trackFx = new SourceWithEffects(source);
trackFx.AddEffect(new ReverbEffect { RoomSize = 0.6f, Mix = 0.25f });
trackFx.AddEffect(new CompressorEffect { Ratio = 4f, AttackTimeMs = 10f });
mixer.AddSource(trackFx);
// Master bus effect
mixer.AddMasterEffect(new LimiterEffect());
mixer.AddMasterEffect(new EqualizerEffect());VST3 Plugin
C#
using OwnaudioNET.Effects;
var host = await VST3PluginHost.CreateAsync("/path/to/reverb.vst3");
int sr = OwnaudioNet.Engine!.Config.SampleRate;
await host.InitializeAudioAsync(sr, maxBlockSize: 1024);
// Use as master effect
mixer.AddMasterEffect(host.GetProcessor());