Recursive AI

Choosing a C# audio library

C# audio libraries compared: NAudio 3, OwnAudioSharp, FFMpegCore, CSCore and OneAudio, by playback, recording, codecs and native code, each fact sourced.

Pick a C# audio library by the job first. To decode, convert, resample, mix, measure, play and record audio from managed code on Windows, Linux and macOS, with no native libraries to ship, use OneAudio: the core package reads WAV, MP3, Ogg Vorbis, Opus and FLAC and writes WAV, FLAC and Opus, and its companion package plays and records through WASAPI, Core Audio and ALSA. For the deepest Windows device support (ASIO, WinMM) plus MIDI and VST 3 hosting, use NAudio 3. OwnAudioSharp is a desktop audio engine built on a native Rust core. For formats and video that only FFmpeg handles, use an FFmpeg wrapper such as FFMpegCore. The facts below come from each project’s own NuGet listing, README or documentation, read on October 26 and 27, 2026.

C# audio libraries at a glance

Library, version, licensePlay and recordDecodeEncodeNative code
OneAudio 1.2.1 and OneAudio.Devices 1.2.1, MIT OR Apache-2.0Windows (WASAPI), macOS and iOS (Core Audio), Linux (ALSA), with the Devices packageWAV and RF64, MP3, Ogg Vorbis, Opus, FLACWAV and RF64, FLAC, Ogg OpusNone shipped: two managed assemblies. Devices calls the operating system’s own audio API
NAudio 3.3.0, MITWindows (WASAPI, WinMM, ASIO); Linux with NAudio.Alsa; macOS with NAudio.MacOS (prerelease)WAV and AIFF everywhere; MP3, AAC, WMA, FLAC through Media Foundation on Windows; WAV, AIFF, FLAC, Ogg Vorbis, Opus, MP3 through NAudio.SoundFileWAV and AIFF; MP3, AAC, WMA through Media Foundation on Windows; FLAC, Ogg Vorbis, Opus, MP3 through NAudio.SoundFileWindows APIs; libasound on Linux; a system libsndfile for NAudio.SoundFile
OwnAudioSharp 4.0.10, MITWindows, Linux, macOSWAV, MP3, FLAC, Ogg Vorbis, AAC/M4A, ALAC/M4A, AIFFWAVA Rust engine, shipped in the package for six runtimes
FFMpegCore 5.5.0, MITNot documentedWhat your ffmpeg build readsWhat your ffmpeg build writesThe ffmpeg and ffprobe programs, installed separately

Sources: NAudio’s package README, its guides to NAudio.SoundFile and MediaFoundationEncoder, and the NAudio.MacOS listing (3.4.0-preview.1, prerelease only). OwnAudioSharp’s README; its native libraries (libownaudio_ffi for Windows, Linux and macOS on x64 and Arm64) are listed from the published package. FFMpegCore’s README, whose “Binaries” section explains how to install ffmpeg. OneAudio’s README and the Devices package’s NuGet listing.

What each library is for

NAudio

NAudio is the most downloaded of these packages, with 14.9 million downloads on NuGet, and version 3 changed what it covers. In his release post (August 15, 2026), Mark Heath writes that NAudio “is no longer Windows-only”: the Windows-only features moved to their own assemblies, NAudio.Core and NAudio.Midi are cross-platform, and NAudio.Alsa plays and records on Linux. It also gained managed effects, VST 3 hosting, a sampler and sequencer, and SoundFont support. NAudio 3 needs net9.0 or later; for .NET Framework and .NET Standard 2.0 the README points to NAudio 2.x.

What still depends on the platform is codecs. On Windows, NAudio reads and writes MP3, AAC and WMA through Media Foundation. Elsewhere, compressed formats go through NAudio.SoundFile, which needs libsndfile installed on the machine. If you need ASIO, NAudio is the one here that has it; MIDI and VST 3 hosting are in NAudio and OwnAudioSharp.

OwnAudioSharp

A full audio engine for desktop apps: playback, recording, multi-track mixing, effects, VST3 hosting and MIDI, with decoding by the Rust Symphonia library, according to its README. The full package depends on Avalonia and Microsoft.ML.OnnxRuntime for its display and analysis features; OwnAudioSharp.Basic is the playback and recording edition.

FFmpeg wrappers

FFMpegCore runs the ffmpeg and ffprobe command-line programs for you. It reaches every format and codec your ffmpeg build has, video included, at the cost of installing and shipping ffmpeg alongside your app and running it as a separate process. When a managed library covers the job instead is the subject of audio in .NET without FFmpeg.

CSCore

CSCore still appears in searches for a C# audio library. Its last NuGet release, 1.2.1.2, is from October 22, 2017, and its license is the Microsoft Public License.

OneAudio

OneAudio handles audio from file to speaker: decoding, encoding, resampling, mixing and loudness in the RecursiveAI.OneAudio package, and playback and recording in RecursiveAI.OneAudio.Devices, both in C# with no dependency beyond .NET. The codecs are written from their specifications and checked against outside references, as the README’s conformance table shows: FLAC decoding is bit-exact on the 64 files of the IETF test suite’s subset, all 12 RFC 8251 Opus vectors pass, and all 11 ISO MP3 compliance streams decode within the standard’s full-accuracy limits.

Program.csOneAudio 1.2.1 · .NET 10
using OneAudio;
 
// Decode an MP3, convert it to 48 kHz, normalize it to -14 LUFS (true peak at most -1 dBTP)
// and write it as FLAC: one call, streamed, no native code.
NormalizeResult result = Audio.Normalize("music.mp3", "music-48k.flac", new NormalizeOptions
{
    Output = new TranscodeOptions { SampleRate = 48000 },
});
Console.WriteLine($"was {result.Before.IntegratedLufs:F1} LUFS, applied {result.GainDb:+0.0;-0.0} dB");
 
var after = Audio.Measure("music-48k.flac");
Console.WriteLine($"music-48k.flac: {after.IntegratedLufs:F1} LUFS, {after.TruePeakDbtp:F1} dBTP");
OutputConsole
was -14.3 LUFS, applied +0.3 dB
music-48k.flac: -14.0 LUFS, -4.8 dBTP

Playing it takes the second package and three lines. The device package opens the default output, follows the system default when it changes, reopens a lost device, and reports what the hardware did from the device’s own clock:

Program.csOneAudio.Devices 1.2.1 · .NET 10
using OneAudio;
using OneAudio.Devices;
 
// Playback: the mixer renders, the device package sends it to the default output (WASAPI, Core Audio or ALSA).
AudioMixer mixer = Audio.CreateMixer();
using AudioOutputDevice output = Audio.Play(mixer);
using StreamingVoice song = mixer.PlayStream("intro.mp3");
 
Thread.Sleep(5500);
DeviceCounters c = output.Counters;
Console.WriteLine($"{output.BackendName}: {c.FramesPlayed} frames played, {c.Underruns} underruns");
OutputConsole · Linux
alsa: 265409 frames played, 0 underruns
  • No native code shipped: two managed assemblies, so dotnet publish for any runtime needs nothing else. The device package reaches the hardware through the operating system’s own audio API: WASAPI on Windows, Core Audio on macOS and iOS, and libasound on Linux, which is how PipeWire and PulseAudio desktops are reached too. The test suite runs on Windows x64, Linux x64 and Arm64, and macOS Arm64.
  • Where the device code has been checked: per the changelog, ALSA playback and capture on Linux, Core Audio playback on macOS and on an iPad, on real hardware; the WASAPI backend by unit tests and on Windows CI. The samples on this site were run on Linux through PipeWire.
  • Trimming and NativeAOT: a small NativeAOT app that loads WAV, resamples, measures loudness and mixes is 1.96 MB on linux-x64 with every decoder, and 1.45 MB when it registers only WAV, per the README.
  • Real-time safe mixing: the mixer has voices, buses, ducking, filters, reverb and a limiter, and its render call allocates nothing and takes no locks. In the README’s benchmark, mixing 256 stereo voices took 71.0 µs per 1,024-frame block. See a zero-allocation audio mixer for C# games.
  • Loudness: an EBU R 128 meter with true peak and one-call normalization. See loudness normalization in C#.
  • Not included: MP3, AAC and Vorbis encoding, AAC decoding, ASIO, MIDI and spatial audio.

Which one to use

  • A server or batch job that reads, converts or analyzes audio: OneAudio. Nothing to install on the server, no native library that differs by OS, and memory that doesn’t grow with file length.
  • An app that plays and records on Windows, Linux and macOS: OneAudio with the Devices package when you also want its decoders, mixer or loudness meter in the same process, with nothing native to ship. See play audio in C# and record audio in C#. NAudio 3 when you need ASIO, WinMM, MIDI or VST 3 hosting. OwnAudioSharp when its desktop engine and UI pieces fit your app.
  • A game: OneAudio’s mixer, played with Audio.Play(mixer) or rendered into the buffer your engine’s audio output asks for, without allocating. See the game audio mixer article.
  • Already on NAudio: move file and signal code to OneAudio and keep NAudio’s player through an ISampleProvider, or move playback too, as shown in migrating from NAudio.
  • AAC, M4A, MP3 encoding or video: FFmpeg, through FFMpegCore, or Media Foundation through NAudio on Windows.

Where next