This project has moved and is read-only. For the latest updates, please go here.

NAudio playing Ogg Vorbis!

Nov 19, 2010 at 12:48 AM
Edited Nov 19, 2010 at 12:53 AM

Hi Mark,

I think NAudio is really cool, but it would be even cooler with Ogg Vorbis playback support.

So I looked around for a managed library (C#) and found with csvorbis (Vorbis#), it is LGPL so it seems like a good candidate.

The link contains a very raw/drafty version of an NAudio Ogg Vorbis wrapper that uses csvorbis.

(The zip contains a free Ogg Vorbis Audio that I download from

The code is not ready for "production" but it does play the file very nicely, including a random seek a file position based on Time (using CurrentTime).

Also the original Vorbis# code is full of warnings which need to be cleaned up..but it seems to be working just fine.

What do you think?




Nov 24, 2010 at 3:02 PM

thanks for this. NAudio can't include any LGPL code due to its MSPL license. However, we could add Ogg playback to a demo project at some point as a demo of what is possible.


Nov 24, 2010 at 3:25 PM

Hi Mark,

No problem.

Regarding the licenses (not an expert at all) - Why can't MSPL include LGPL? AFAIK MSPL does not mandate distributing of its own sources but it can still include sources of other projects.

I mean, assuming the NAudioOgg was a LGPL plug-in (a C# project outside of NAudio), I don't see a contradiction.

Also - would you consider moving NAudio to LGPL? What is the big advantage of using MSPL over LGPL? I'm probably missing something here.



Nov 24, 2010 at 3:32 PM

I can only include LGPL as compiled binaries - so it would be OK for the demo project. NAudio is MSPL as it is the most commercial friendly licence.


Nov 24, 2010 at 3:45 PM

OK, last few questions: what about the reverse?

Can I use NAudio with my LGPL code? I understand these licenses are incompatible, but not sure - is it OK?

Are there any restrictions? Do I need to include a license file (e.g. NAUDIO_LICENSE) or something similar?

What if my project was under MIT license? Would that be OK for NAudio and Practice#?



Nov 24, 2010 at 4:03 PM

yes, NAudio can be used in any project. The NAudio license is permissive, so you can include the NAudio.dll or the whole source tree if you prefer


Nov 24, 2010 at 6:26 PM

Thanks for the explanations.

As a result I decided to also include all 3rd party sources, NAudio in particular, in  Practice# GoogleCode subversion repository.

This kind of "gaps between the two worlds" (LGPL and MS-PL).