41

I am looking to develop an audio player in C#, but was wondering what libraries are available for playback. I am looking for a free library that allows for an extensive list of audio formats to be played (for example mp3, wma, wav, ogg, etc.) Thats pretty much the basic functionality I would need. But if I could get picky, a library that can convert audio files between the formats would be handy. Doing a google search I came across the alvas.audio library, but it wasn't free. The VLC library would be nice too, but I couldn't get it to work, and I'd prefer to just package my application with a dll instead of having my users have the VLC software installed on their machine as well.

Thanks for any tips or advice on this.

Nick
  • 2,265
  • 7
  • 30
  • 34

6 Answers6

48

NAudio is an open source .NET audio library that can play back WAV, MP3, WMA, AAC and AIFF files, making use of ACM or Media Foundation codecs installed on your computer for decompression purposes. For ogg support, there is an add-on nuget package you can use.

(Edit: updated with details of supported audio file types in NAudio 1.7. Also, full disclosure: I am the author of this library)

Piotr Kula
  • 9,597
  • 8
  • 59
  • 85
Mark Heath
  • 48,273
  • 29
  • 137
  • 194
14

Bass Audio Library is one option.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
7

Alvas.Audio

This library doesn't seem to be developed any further, I purchased a lifetime team license and haven't been able to get in touch with the developer since November 2011, no answer after many emails, and no new versions despite the promise to create new versions quarterly. Also didn't get any kind of message from the developer that he is abandoning the project.

Community
  • 1
  • 1
Alex
  • 133
  • 2
  • 4
6

You will want to take a look at DirectShow. DirectShow is an unmanaged library which depends on the codecs installed on the user's system for which you can create render graphs. DirectShow is free and usually installed on most Windows machines.

There is a managed wrapper for DirectShow titled DirectShow.NET, which you can find here:

http://directshownet.sourceforge.net/

casperOne
  • 73,706
  • 19
  • 184
  • 253
4

As of 2012, OpenAL seems to be a viable library -- and something of a standard. It works on a range of OSes (from XP to Windows 8), and integrates with (is already integrated with) MonoGame.

Since the Creative Labs link (above) is down, you can try one of these instead:

ashes999
  • 9,925
  • 16
  • 73
  • 124
3

irrKlang is a C++ audio library with a .NET API. It is free for non-commercial use.

sourcenouveau
  • 29,356
  • 35
  • 146
  • 243