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.
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 versionsMigration 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: