Cross-platform audio engine library for desktop platforms (Windows, Linux, macOS)
$ dotnet add package OwnAudioSharp
OwnAudioSharp is a cross-platform C# audio library providing professional-grade audio playback, recording, and processing. Built with pure managed code using native system audio APIs - no external dependencies required.
Advanced AI-driven audio separation technology for separating songs into vocal and instrumental components. It uses state-of-the-art ONNX neural network models with STFT-based processing and intelligent noise reduction.
See the document for a detailed description! Try the sample code
Version 2.0.0 introduces major improvements!
Pre-2.0.0 versions relied on native libraries (miniaudio, portaudio, ffmpeg) and were less optimized. Starting from version 2.0.0, OwnAudioSharp operates with zero external dependencies using a fully managed audio engine.
Key changes:
[Obsolete] - will be removed in future versionsUsing OwnaudioSharp version 2 with older code: If you need pre-2.0.0 functionality because you wrote your code for an older version of OwnaudioSharp, replace the Ownaudio namespaces in your code with the OwnaudioLegacy namespace. for example: Ownaudio.Source => OwnaudioLegacy.Source
Migration recommendation: Use version 2.0.0 or later for all new projects. The new managed engine offers superior performance and maintainability.
Install-Package OwnAudioSharpdotnet add package OwnAudioSharpComplete documentation is available on the official website:
using Ownaudio.Core;
using Ownaudio.Decoders;
// Create audio engine with default settings
using var engine = AudioEngineFactory.CreateDefault();
engine.Initialize(AudioConfig.Default);
engine.Start();
// Create decoder for audio file
using var decoder = AudioDecoderFactory.Create(
"music.mp3",
targetSampleRate: 48000,
targetChannels: 2
);
// Decode and play frames
while (true)
{
var result = decoder.DecodeNextFrame();
if (result.IsEOF) break;
engine.Send(result.Frame.Samples);
}
engine.Stop();If you find this library useful or use it for commercial purposes, consider supporting the development:
See the LICENSE file for details.
Special thanks to the creators of: