NAudio
August 15, 2026 ยท View on GitHub
NAudio is an open source .NET audio library written by Mark Heath

๐ Documentation site โ tutorials and the full API reference.
NAudio 3
NAudio 3 is a major release. The headlines:
- The single
NAudioassembly is split into focused packages โ take only what you need. TheNAudiometa-package still pulls the Windows stack together, so existing consumers see no change. - The core is cross-platform and Native-AOT compatible.
NAudio.Core,NAudio.Midi,NAudio.Effects,NAudio.SamplerandNAudio.SoundFilerun on Windows, Linux and macOS. - Minimum target framework is
net9.0โ legacy .NET Framework and .NET Standard 2.0 support is dropped. - New subsystems: an audio effects framework, a software sampler, VST 3 hosting, ALSA playback/capture on Linux, and cross-platform file I/O via libsndfile.
- Modernised WASAPI and ASIO โ the new
WasapiPlayer/WasapiRecorderandAsioDeviceAPIs.
Upgrading from NAudio 2? Start with Migrating from NAudio 2 to NAudio 3. The full list of changes is in RELEASE_NOTES.md.
Packages
Installing the NAudio meta-package gets you the full Windows stack and is the right default. On a non-Windows target framework it resolves to the cross-platform pieces only. Reference the individual packages directly if you want a smaller surface.
| Package | Platform | What it gives you |
|---|---|---|
| NAudio | any | Meta-package โ the Windows stack plus AudioFileReader and Mp3FileReader |
| NAudio.Core | cross-platform | WaveStream / ISampleProvider model, WAV & AIFF I/O, mixing, resampling, DSP, NAudio.Effects, sequencing |
| NAudio.Midi | cross-platform (+ WinRT MIDI on Windows) | MIDI event model, Standard MIDI File reading & writing |
| NAudio.Wasapi | Windows | WASAPI playback, capture and loopback; Media Foundation codecs |
| NAudio.WinMM | Windows | WaveOut / WaveIn, classic MIDI I/O, ACM codecs, mixer controls |
| NAudio.Asio | Windows | Low-latency multichannel playback and capture through ASIO drivers |
| NAudio.Dmo | Windows | DMO effects, DMO MP3 decoder and resampler, DirectSoundOut |
| NAudio.WinForms | Windows | WinForms controls, and the window-callback WaveOutWindow / WaveInWindow |
| NAudio.Sampler | cross-platform | Polyphonic software sampler โ SoundFont (.sf2), SFZ and single-sample instruments |
| NAudio.SoundFile | cross-platform | Read and write WAV/AIFF/FLAC/Ogg-Vorbis/Opus/MP3 via libsndfile |
| NAudio.Alsa | Linux | AlsaOut / AlsaIn playback and capture via libasound |
| NAudio.Vst3 | Windows | VST 3 plug-in hosting (preview) โ effects and instruments |
| NAudio.Extras | cross-platform (+ Windows extras) | Opinionated helpers โ playback engine, capture mixing, ID3 tags |
NAudio.Core, NAudio.Midi, NAudio.Wasapi, NAudio.Dmo, NAudio.Sampler, NAudio.SoundFile and NAudio.Alsa are Native-AOT compatible. See the assembly layout plan for the reasoning behind the split.
Documentation
- Documentation site โ tutorials and the full API reference.
- Tutorials โ the task-focused how-to guides listed below, also in Docs/.
- Migrating from NAudio 2 โ every breaking change, with before/after code.
- NAudio articles on Mark Heath's blog.
NAudio comes with several demo applications, which are the quickest way to see how the various features fit together: NAudioDemo (WinForms), NAudioWpfDemo, and the smaller NAudioConsoleTest, AudioFileInspector, MidiFileConverter and MixDiff tools. They have the advantage of being kept up to date, whilst some of the tutorials you will find on the internet refer to old versions of NAudio.
Features
- Play back audio using a variety of APIs
- WASAPI (
WasapiPlayer, and the legacyWasapiOut) - WaveOut
- ASIO
- DirectSound
- ALSA on Linux
- WASAPI (
- Read audio from many standard file formats
- WAV, AIFF and raw PCM
- MP3 (using ACM, DMO or MFT)
- G.711 mu-law and a-law
- ADPCM, G.722, Opus (using Concentus)
- WMA, AAC, MP4 and more with Media Foundation
- FLAC, Ogg Vorbis, Opus and MP3 cross-platform with libsndfile
- Convert between various forms of uncompressed audio
- Change the number of channels โ mono to stereo, stereo to mono, and arbitrary matrix routings
- Modify bit depth (8, 16, 24, 32 integer or 32 bit IEEE float)
- Resample audio using a choice of resampling algorithms
- Encode audio using any ACM or Media Foundation codec installed on your computer
- Create MP3s, AAC/MP4 audio and WMA files
- Create WAV files containing G.711, ADPCM, G.722, etc.
- Encode FLAC, Ogg Vorbis and Opus on any platform with
NAudio.SoundFile
- Mix and manipulate audio streams using a 32-bit floating point mixing engine
- construct signal chains
- examine sample levels for the purposes of metering or waveform rendering
- pass blocks of samples through an FFT for metering or DSP
- delay, loop, or fade audio in and out
- Apply audio effects with the cross-platform
NAudio.Effectsframework- EQ and filtering, dynamics (compressor, limiter, gate, multiband), saturation and lo-fi
- delay and modulation, reverb including FFT convolution, pitch shifting
- click-free bypass, dry/wet mix and a parameter model for automation
- Record audio using a variety of capture APIs
- WASAPI (
WasapiRecorder), including system audio and per-process loopback - WaveIn
- ASIO
- ALSA on Linux
- WASAPI (
- Host VST 3 effects and instruments
- Play SoundFont (
.sf2) and SFZ instruments with the built-in software sampler - Work with soundcards
- Enumerate devices
- Access soundcard controls and metering information
- Follow the default device automatically, and observe endpoint changes as events
- Full MIDI event model
- Read and write MIDI files
- Respond to received MIDI events
- Send MIDI events
- Render a MIDI file to audio through the sampler or a hosted VST 3 instrument
- An extensible programming model
- All base classes easily inherited from for you to add your custom components
Tutorials
Upgrading
Playback
- Playing an Audio File from a WinForms application
- Playing an Audio File from a Console application
- Playing Audio from a URL
- Choose an audio output device type
- Enumerate and select Output Devices
- Playing audio with WasapiPlayer (recommended for WASAPI)
- Creating and configuring a WasapiOut device (legacy)
- Implement "Fire and Forget" Playback (e.g. game sound effects)
- Play streaming MP3
- Handling playback stopped
- Understanding WaveStream, IWavePlayer and ISampleProvider
- Playing Audio with ASIO
Working with Codecs
- Convert an MP3 to WAV
- Encode to MP3 and other formats using MediaFoundationEncoder
- Understand how to convert between any audio formats you have codecs for
- Enumerate Media Foundation Transforms (MFTs)
- Enumerate ACM Codecs
- Fix the NoDriver calling acmFormatSuggest issue
Working with audio files
- Mix Two Audio Files to WAV
- Cross-platform audio files with NAudio.SoundFile
- Trim a WAV File
- Merge MP3 Files
- Convert an AIFF file to WAV
- Use the WavFileWriter class
Manipulating audio
- Convert between mono and stereo
- Concatenating Audio
- Skip and Take Using OffsetSampleProvider
- Implement Looped Playback
- Work with Multi-Channel Audio
- Resample Audio
- Input driven Audio Resampling
- Using RawSourceWaveStream
- Adjust the pitch of audio using SmbPitchShiftingSampleProvider
- Varispeed playback with NAudio using SoundTouch
- Fade audio in and out
- Apply audio effects with NAudio.Effects
Generating audio
- Play Sine Waves and other signal types
- Implement sine wave with portamento
- Play SoundFont, SFZ and single-sample instruments
Recording
- Recording a WAV file from a WinForms application
- Recording audio with WasapiRecorder (recommended for WASAPI)
- Capturing system audio with WasapiLoopbackCapture (legacy)
- Mix the microphone and system audio
- Play and Record audio at the same time
- Record Audio with ASIO
- Duplex Processing with ASIO
- ASIO Channel Mapping
- Handling ASIO Driver Resets
Visualization
MIDI
Networking
Cross-platform and Linux
- Cross-platform audio files with NAudio.SoundFile
- Playing an audio file on Linux with ALSA
- Recording an audio file on Linux with ALSA
- Validating ALSA on Linux
NAudio Training Courses
If you want to get up to speed as quickly as possible with NAudio programming, I recommend you watch these two Pluralsight courses. You will need to be a subscriber to access the content, but there is 10 hours of training material on NAudio, and it also will give you access to their vast training library on other programming topics.
To be successful developing applications that process digital audio, there are some key concepts that you need to understand. To help developers quickly get up to speed with what they need to know before trying to use NAudio, I have created the Digital Audio Fundamentals course, which covers sample rates, bit depths, file formats, codecs, decibels, clipping, aliasing, synthesis, visualisations, effects and much more. In particular, the fourth module on signal chains is vital background information if you are to be effective with NAudio.
Audio Programming with NAudio is a follow-on course which contains seven hours of training material covering all the major features of NAudio. It is highly recommended that you take this course if you intend to create an application with NAudio.
Please note that these courses were recorded against earlier versions of NAudio. The concepts all still apply, but some of the class names have changed โ see Migrating from NAudio 2 to NAudio 3.
FAQ
What is NAudio?
NAudio is an open source audio API for .NET written in C# by Mark Heath, with contributions from many other developers. It is intended to provide a comprehensive set of useful utility classes from which you can construct your own audio application.
Why NAudio?
NAudio was created because the Framework Class Library that shipped with .NET 1.0 had no support for playing audio. The System.Media namespace introduced in .NET 2.0 provided a small amount of support, and the MediaElement in WPF and Silverlight took that a bit further. The vision behind NAudio is to provide a comprehensive set of audio related classes allowing easy development of utilities that play or record audio, or manipulate audio files in some way.
Does NAudio work on Linux and macOS?
Partly, and much more so in NAudio 3. NAudio.Core, NAudio.Midi, NAudio.Effects, NAudio.Sampler and NAudio.SoundFile are fully cross-platform, so signal chains, file I/O, DSP, effects and MIDI all work anywhere .NET runs. For output and capture, Linux has NAudio.Alsa; the WASAPI, WinMM, ASIO, DMO and WinForms packages remain Windows-only, and there is no macOS (CoreAudio) backend yet (although there is a work-in-progress implementation).
Which .NET versions are supported?
NAudio 3 requires net9.0 or later. If you need .NET Framework or .NET Standard 2.0, stay on NAudio 2.x.
Can I Use NAudio in my Project?
NAudio is licensed under the MIT license which means that you can use it in whatever project you like including commercial projects. Of course we would love it if you share any bug-fixes or enhancements you made to the original NAudio project files.
Is .NET Performance Good Enough for Audio?
While .NET cannot compete with unmanaged languages for very low latency audio work, it still performs better than many people would expect. On a fairly modest PC, you can quite easily mix multiple WAV files together, including pass them through various effects and codecs, play back glitch free with a latency of around 50ms.
How can I get help?
There are three main ways to get help. First, you can raise an issue here on GitHub. This is the best option when you've written some code and want to ask why it's not working as you expect. I attempt to answer all questions, but since this is a spare time project, occasionally I get behind.
You can also ask on StackOverflow and tag your question with naudio, if your question is a "how do I..." sort of question. This gives you a better chance of getting a quick answer. Please try to search first to see if your question has already been answered elsewhere.
Finally, I am occasionally able to offer paid support for situations where you need quick advice, bugfixes or new features. Please contact Mark Heath directly if you wish to pursue this option.
How do I submit a patch?
I welcome contributions to NAudio and have accepted many patches, but if you want your code to be included, please familiarise yourself with the following guidelines:
- Your submission must be your own work, and able to be released under the MIT license.
- You may use AI-assisted code generation, but ensure that your code is original and not copied from other sources. Note that I may choose to rewrite contributions rather than merge pull requests, so consider raising a feature request rather than a pull request first.
- You will need to make sure your code conforms to the layout and naming conventions used elsewhere in NAudio.
- Remember that there are many existing users of NAudio. A patch that changes the public interface is not likely to be accepted.
- Try to write "clean code" - avoid long functions and long classes. Try to add a new feature by creating a new class rather than putting loads of extra code inside an existing one.
- I don't usually accept contributions I can't test, so please write unit tests (using NUnit) if at all possible. If not, give a clear explanation of how your feature can be unit tested and provide test data if appropriate. Tell me what you did to test it yourself, including what operating systems and soundcards you used.
- If you are adding a new feature, please consider writing a short tutorial on how to use it.
- Unless your patch is a small bugfix, I will code review it and give you feedback. You will need to be willing to make the recommended changes before it can be integrated into the main code.
- Patches should be provided using the Pull Request feature of GitHub.
- Please also bear in mind that when you add a feature to NAudio, that feature will generate future support requests and bug reports. Are you willing to stick around on the forums and help out people using it?