AI Features
AI-powered audio processing. Available in OwnAudioSharp only — not in the Basic package.
These features require the full OwnAudioSharp NuGet package. They are not available in OwnAudioSharp.Basic.
ONNX model files are not bundled in the NuGet package. They are downloaded automatically on first use via VocalRemoverModelManager.DownloadModelAsync() and stored in the user's local application data folder. No manual setup is required.
Vocal Remover
Separates vocals from instrumental using ONNX neural network models. Namespace: OwnaudioNET.Features.Vocalremover
C# — Download model & separate
using OwnaudioNET.Features.Vocalremover;
// Download the model on first run (skipped automatically if already present)
if (!VocalRemoverModelManager.IsModelAvailable(InternalModel.Best))
{
await VocalRemoverModelManager.DownloadModelAsync(
InternalModel.Best,
new Progress<ModelDownloadProgress>(p =>
Console.Write($"\rDownloading: {p.Percentage:F1}%")));
}
var options = new SimpleSeparationOptions
{
Model = InternalModel.Best, // see model table below
OutputDirectory = "output/",
DisableNoiseReduction = false // true = skip noise reduction
};
using var separator = new SimpleAudioSeparationService(options);
separator.Initialize();
var result = separator.Separate("song.mp3");
Console.WriteLine(result.VocalsPath); // path to vocals-only file
Console.WriteLine(result.InstrumentalPath); // path to instrumental-only fileVocalRemoverModelManager
| Member | Description |
|---|---|
DefaultModelsDirectory | Get/set the local folder where model files are stored. Defaults to LocalApplicationData/OwnAudio/models/. Override at startup to redirect storage. |
IsModelAvailable(model) | Returns true if the model file is already present on disk. |
DownloadModelAsync(model, progress, cancel) | Downloads a single model from HuggingFace. Skips silently if the file already exists. Reports ModelDownloadProgress with byte count and percentage. |
EnsureModelsAvailableAsync(models, progress, cancel) | Downloads all models in the collection that are not yet present. Models are fetched sequentially. |
Available Models
| Model | Size | Speed | Quality | Best for |
|---|---|---|---|---|
InternalModel.Default | ~28 MB | Medium | Very Good | General purpose |
InternalModel.Best | ~50 MB | Slow | Excellent | Final quality separation |
InternalModel.Karaoke | ~28 MB | Medium | Excellent | Karaoke tracks, preserves vocals |
InternalModel.HTDemucs | ~166 MB | Slowest | Highest | Multi-stem (vocals, bass, drums, other) |
SimpleSeparationOptions
| Property | Type | Description |
|---|---|---|
Model | InternalModel | Which ONNX model to use for separation. |
ModelPath | string? | Optional path to a custom ONNX file. Takes precedence over Model when set and the file exists. |
OutputDirectory | string | Directory where output files are written. |
DisableNoiseReduction | bool | Set to true to skip post-processing noise reduction (default: false). |
EnableGPU | bool | Use GPU acceleration via CoreML (macOS) or CUDA (Windows/Linux). Default: true. |
ChunkSizeSeconds | int | Audio chunk size in seconds. 0 processes the entire file at once. Default: 15. |
Chord Detection
Detects musical chords, key, and tempo from audio files. Namespace: OwnaudioNET.Features
C# — From a file
var (chords, key, bpm) = ChordDetect.DetectFromFile("song.mp3", intervalSecond: 1.0f);
foreach (var chord in chords)
Console.WriteLine($"{chord.TimeSeconds:F1}s {chord.ChordName}");
Console.WriteLine($"Key: {key} BPM: {bpm}");C# — From multiple files (mixed)
// Mixes all files before analysis
var (chords, key, bpm) = ChordDetect.DetectFromFiles(
new[] { "guitar.wav", "piano.wav" },
intervalSecond: 0.5f);C# — Real-time detection
// Continuous detection from an active note stream
var (chord, stability) = ChordDetect.DetectRealtime(
notes, // List<Note>
DetectionMode.Standard,
bufferSize: 4096);
Console.WriteLine($"Chord: {chord} Stability: {stability:P0}");Return Types
| Member | Type | Description |
|---|---|---|
chords | List<TimedChord> | List of chords with timestamps. |
TimedChord.TimeSeconds | double | Timestamp in seconds. |
TimedChord.ChordName | string | Chord name (e.g. "Cmaj", "Am7"). |
key | MusicalKey | Detected musical key. |
bpm | int | Detected tempo in BPM. |
stability | float | Real-time detection confidence (0.0–1.0). |
Auto-Mastering (Matchering)
AI-driven EQ matching and automated audio mastering. Namespace: OwnaudioNET.Features
C# — Analyze spectrum
AudioSpectrum spectrum = AudioAnalyzer.AnalyzeAudioFile("track.wav");C# — EQ match to reference
AudioAnalyzer.ProcessEQMatching(
sourceFile: "my-mix.wav",
targetFile: "reference.wav", // the "sound" to match
outputFile: "mastered.wav");C# — Apply playback system preset
AudioAnalyzer.ProcessWithEnhancedPreset(
sourceFile: "my-mix.wav",
outputFile: "for-club.wav",
system: PlaybackSystem.Club, // Club, Car, Studio, HomeTheater
eqOnlyMode: true);C# — Batch process
AudioAnalyzer.BatchProcessWithEnhancedPreset(
sourceFiles: new[] { "track1.wav", "track2.wav", "track3.wav" },
baseSampleFile: "reference.wav",
outputDirectory: "output/",
system: PlaybackSystem.Studio,
fileNameSuffix: "_mastered");PlaybackSystem Values
| Value | Description |
|---|---|
PlaybackSystem.Club | Optimized for nightclub / dance floor sound systems |
PlaybackSystem.Car | Optimized for in-car audio systems |
PlaybackSystem.Studio | Neutral studio monitor reference |
PlaybackSystem.HomeTheater | Home theater speaker systems |