Note: this documentation also available in Russian (thanks to Du10)

Getting Started with NAudio

The easiest way to install NAudio into your project is to install the latest NuGet NAudio package. Prerelease versions of NAudio are also often made available on NuGet.

Alternatively, you can download the latest release in binary format from the downloads tab here at CodePlex.

NAudio comes with several demo applications which are the quickest way to see how to use the various features of NAudio. You can download compiled demo applications from the downloads tab, and explore the source code here.

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.

How do I...?

The best way to learn how to use NAudio is to download the source code and look at the two demo applications - NAudioDemo and NAudioWpfDemo. These demonstrate several of the key capabilities of the NAudio framework. They also 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.

NAudio 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.

Can I Use NAudio in my Project?

NAudio is licensed under the Microsoft Public License (Ms-PL) 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 ask a question on the NAudio discussion forums here on CodePlex. 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. Use the contact feature of the Codeplex website to get in touch with Mark Heath 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 MS-PL license.
  • 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.
  • The easiest way to provide a patch is to create your own fork on Mercurial and issue a pull request. See this video if you are new to Mercurial.
  • 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

Last edited Feb 3, 2015 at 12:28 PM by markheath, version 41


Pradeepcse23 Mar 24 at 6:21 AM 
we have been using naudio since 3-4 years, works pretty well for us. now we need to support our application in other browser other than IE. I tried to play the audio but nothing works. can you please let us know, will this supports other browser as well.?

worm2373 Jun 3, 2015 at 3:36 PM 
Hi, is there any reference page? Something similar as this for Cpp?

debabrataghosh Apr 9, 2015 at 10:53 AM 
Hi Mark,
I am a software developer in windows Platform , I am making one application "which is having some .mp3,.wav files " and my expectation is to compare the music file with each other. It means that , here i capture one music file from Mic (With Noise) and i need to compare the two music files. For that if u have any solution . I already made one algo for that but that is not working some critical situation.
Can u give any solution .
Thank u .
Debabrata Ghosh.

eejake52 May 26, 2014 at 7:49 PM 
The link to the training video on how to use Mecurial is broken.

MASOUD1 Dec 24, 2013 at 3:53 PM 
please can any one tell me how can i take sample of the wave file if that is mono will take mono or stereo will take it as it without any convert plaseeeeeeeeee

digimunk Oct 31, 2013 at 8:40 PM 
Under "Getting Started with NAudio – Downloading and Compiling" the second sentence in item 2 begins with "Class Library's." It should be "Class Libraries."
The second sentence under item 3 contains "...if your copying..." which should be "...if you're copying..."