It has been well over a year since I last released a version of NAudio, and since then there have been loads of new features and bugfixes added, so I have decided it is time for a new drop. Another reason for releasing now is that NAudio has been getting a lot more attention recently, mainly due to StackOverflow (and even got a mention on This Week on Channel 9).
As always, head to CodePlex to download the latest source code and binaries.
WaveOuthas a new constructor (this is breaking change), which allows three options for
waveOutcallbacks. This is because there is no “one size fits all” solution, but if you are creating
WaveOuton the GUI thread of a WinForms or WPF application, then the default constructor should work just fine.
WaveOutalso allows better flexibility over controlling the number of buffers and desired latency.
WaveFileReadercan have a stream as input, and
WaveFileWritercan write to a stream. These features are useful to those wanting to stream data over networks.
- The new
IWaveProviderinterface is like a lightweight
WaveStream. It doesn’t support repositioning or length and current position reporting, making the implementation of synthesizers much simpler. The
IWavePlayerinterface takes an IWaveProvider rather than
IWaveProvider, so existing code continues to work just fine.
- Added in
WaveProvider16helper classes. Expect more to be built upon these in the future.
- I have also started using the
WaveBufferclass. This clever idea from Alexandre Mutel allows us to trick the .NET type system into letting us cast from
short. This improves performance by eliminating unnecessary copying and converting of data.
- There have been many bugfixes including better support for VBR MP3 file playback.
- The mixer API has had a lot of bugs fixed and improvements, though differences between Vista and XP continue to prove frustrating.
- The demo project (NAudioDemo) has been improved and includes audio wave-form drawing sample code.
- There is now a WPF demo as well (NAudioWpfDemo), which also shows how to draw wave-forms in WPF, and even includes some preliminary FFT drawing code.
WaveInsupport has been updated and enhanced.
WaveInStreamis now obsolete.
- WASAPI audio capture is now supported.
- NAudio should now work correctly on x64 operating systems (accomplished this by setting Visual Studio to compile for x86).
As usual, I welcome any feedback on this release. Do let me know if you use NAudio to build anything cool.