Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.18 KB

File metadata and controls

39 lines (28 loc) · 1.18 KB
_layout landing

NAudio

NAudio is an open source .NET audio library written by Mark Heath. It provides a comprehensive set of classes for playing, recording, converting and manipulating audio in .NET applications.

Get started

  • Tutorials — task-focused how-to guides covering playback, recording, codecs, MIDI, visualisation and more.
  • API Reference — the full class library reference, generated from the source XML documentation.
  • NAudio on NuGet — install the package into your project.
  • Source on GitHub — browse the code, demos and issues.

Installation

dotnet add package NAudio

A quick example

Playing an audio file is just a few lines:

using NAudio.Wave;

using var audioFile = new AudioFileReader("myfile.mp3");
using var player = new WasapiPlayerBuilder().Build();
player.Init(audioFile);
player.Play();
while (player.PlaybackState == PlaybackState.Playing)
{
    Thread.Sleep(500);
}

See the tutorials for many more worked examples.