It has been far too long coming I know, but I have finally got round to uploading a release candidate for NAudio 1.4. Assuming no glaring bugs are reported in the next week or so, I’ll drop the “RC” from the title.
So what’s new in this latest release?
- Major interop improvements to support native x64. Please note that I have not in this release changed the dll’s target platform away from x86 only as I don’t personally have an x64 machine to test on. However, we are now in a state where around 95% of the interop should work fine in x64 mode so feel free to recompile for “any CPU”. You should also note that if you do run in native x64 mode, then you probably will find there are no ACM codecs available, so
WaveFormatConversionStreammight stop working – another reason to stay targeting x86 for now.
- There have also been major enhancements to MP3 File Reader, which is the main reason for pushing this new release out. Please read this post for more details as this is a breaking change – you no longer need to use a
- More examples
IWaveProviderimplementers have been added, including the particularly useful
BufferedWaveProviderwhich allows you to queue up buffers to be played on demand.
- The NAudioDemo project has been updated to attempt to show best practices (or at least good practices) of how you should be using these classes.
- The NAudioDemo project also now demonstrates how to select the output device for
WaveChannel32can now take inputs of more bit depths – 8, 16, 24 and IEEE float supported. NAudioDemo shows how to play back these files.
- A general spring clean removed a bunch of obsolete classes from the library.
AsioOutmore reliable, although I still think there are more issues to be teased out. Please report whether it works on your hardware.
WaveFileWritersupport for 24 and 32 bit samples
- Allow arbitrary chunks to appear before
fmtchunk in a WAV file
- Reading and writing WAV files with Cues
- Obsoleted some old
- Fixed a longstanding issue with
WaveOutResethanging in function callbacks on certain chipsets
- Added sequencer specific MIDI event
RawWaveSourceStreamturns a raw audio data stream into a
- A DMO MP3 Frame Decoder as an alternative to the ACM one
- Easier selection of DirectSound output device
WaveOutuses 2 buffers not 3 by default now (a leftover from the original days of NAudio when my PC had a 400MHz Pentium II processor!).
- Lots more minor bug fixes & patches applied – see the check-in history for full details
Let me take this opportunity to say thank you to those who have offered many feature suggestions, patches and bug reports. It is also very exciting to see NAudio being used for all kinds of cool applications. I am trying to keep the main project page updated with a list of all of them so get in touch and tell me what you are using NAudio for.
I am sorry I have struggled to keep up with all the questions appearing on the NAudio forums and a growing number of stackoverflow NAudio questions. I try to answer everything, but sometimes I get too far behind and some questions have been left unanswered. NAudio is a spare time project for me, and with the recent birth of my fifth child, time is at a premium, so please be patient! Thanks also to those who have helped out by writing tutorials and answering questions (OpenSebJ and Yuval especially).
Should I Upgrade?
If your app works fine then I actually don’t recommend that you update as there are a (small) number of breaking API changes (mostly for those using
Mp3FileReader). However, for all new applications, or if you are prepared to make some small code changes, then I recommend you use the latest.
Using NAudio is as simple as referencing the NAudio DLL and using whatever pieces you need. (I might have a go at creating a NuGet package for NAudio to make things even easier). To find out how to do something, first look at the NAudioDemo application as this showcases a number of core features. There are also plenty of tutorials on this blog, and on the Documentation tab of the CodePlex site. If they don’t give you an answer, feel free to ask a question on the forums or Stack Overflow.
If you feel that NAudio is missing something you need, remember that NAudio is designed to make it as easy as possible to extend its feature set by inheriting from the base classes and interfaces such as
IWaveProvider. In many cases you can add the new feature you need in for the outside.
There were of course, lots of things I wanted to get into this release that will have to wait for the next one. Here’s some of my ideas. Please feel free to get in touch and tell me what would be most beneficial to you.
- Include an effects framework (based on what I prototyped with Skype Voice Changer)
- Update the MP3 code to more easily support network streaming
- Make a Silverlight / WP7 DLL containing the parts of NAudio that do not rely on Windows APIs.
- ASIO recording support.
- Possibly switch the source control over to Mercurial to make patching easier
- And I’ll also try to write a few more tutorials here on my blog, as I know many people have complained about the lack of documentation.