NAudio Changelog

What's new in NAudio 2.2.1

Sep 26, 2023
  • WdlResampler is now public
  • WASAPI uses background threads
  • MmException can return function name
  • ErrorCodes provides all the AUDCLNT_E HRESULT values from audioclient.h
  • AiffFileWriter chunk size bugfix
  • Support for Device Topology API (IPart, IAudioAutoGainControl, IAudioMute, IAudioVolumeLevel , IControlChangeNotify, IControlInterface, IKsJackDescription, IPerChannelDbLevel)
  • Add ComImport attribute to CoreAudioApi interfaces
  • Ability to set attribute on MediaType, and to specify MediaFoundationEncode buffer size
  • WASAPI stop improvements
  • FLAC and ALAC added to audio subtypes list
  • MediaFoundationEncoder bugfixes for null reference
  • Sysex dispose bugfix
  • Note: this replaces v2.2.0. Incorrectly versioned NAudio.Wasapi.dll (was 22.0) retired and replaced with 2.2.1

New in NAudio 2.1.0 (May 15, 2022)

  • Improved targeting to make it easier to use on non-Windows platforms
  • AudioFileReader will use MediaFoundationReader as the default for MP3s
  • Minimum supported Win 10 version is now uap10.0.18362 (SDK version 1903)
  • IWavePlayer now has an OuputWaveFormat property
  • WasapiCapture and WasapiLoopbackCapture support sample rate conversion so you can capture at a sample rate of your choice
  • WasapiOut supports built-in sample rate conversion in shared mode
  • MediaFoundationEncoder allows you to encode to a Stream

New in NAudio 1.8.4 (Oct 11, 2018)

  • Windows 10 Universal build now included in NuGet package
  • adding a TotalTime property to WaveFileWriter
  • adding a Broadcast Wave File Writer
  • Various bugfixes and enhancements
  • Prevent audio files from staying locked
  • additional constructor for MultiplexingWaveProvider
  • Faster SilenceWaveProvider implementation #257
  • fixing calling stoprecording without ever starting recording on WaveIn
  • improved reliability in WaveInEvent
  • make non-strict MIDI file checking tolerant of invalid CC values #250
  • Adding defaults for StereoToMonoProvider16 volumes #267

New in NAudio 1.5 (Apr 9, 2012)

  • Now available on NuGet
  • Numerous bugfixes mean we are now working fully in x64 as well as x86, so NAudio.dll is now marked as AnyCPU. (You can still force x86 by marking your own executable as x86 only.)
  • WaveOutEvent – a new WaveOut mode with event callback, highly recommended instead of WaveOut with function callbacks
  • 24 bit ASIO driver mode (LSB)
  • Float LSB ASIO driver mode
  • WaveFileWriter has had a general code review and API cleanup
  • Preview of new ISampleProvider interface making it much easier to write custom 32 bit IEEE (float) audio pipeline components, without the need to convert to byte[]. Lots of examples in NAudioDemo of using this and more documentation will follow in future
  • Several ISampleProvider implementations to get you started. Expect plenty more in future NAudio versions
  • PanningSampleProvider
  • MixingSampleProvider
  • MeteringSampleProvider
  • MonoToStereoSampleProvider
  • NotifyingSampleProvider
  • Pcm16BitToSampleProvider
  • Pcm8BitToSampleProvider
  • Pcm24BitToSampleProvider
  • SampleChannel
  • SampleToWaveProvider
  • VolumeSampleProvider
  • WaveToSampleProvider
  • Added AiffFileReader courtesy of Giawa
  • AudioFileReader to simplify opening any supported file, easy volume control, read/reposition locking
  • BufferedWaveProvider uses CircularBuffer instead of queue (less memory allocations)
  • CircularBuffer is now thread-safe
  • MP3Frame code cleanup
  • MP3FileReader throws less exceptions
  • ASIOOut bugfixes for direct 16 bit playback
  • Some Demos added to NAudioDemo to give simple examples of how to use the library
  • NAudioDemo has an ASIO Direct out form, mainly for testing the AsioOut class at different bit depths (still recommended to convert to float before you get there)
  • NAudioDemo has simple MP3 streaming form (play MP3s while they download)
  • NAudioDemo has simple network streaming chat application
  • NAudioDemo playback form uses MEF to make it much more modular and extensible (new output drivers, new file formats etc)
  • NAudioDemo can play aiff
  • GSM 6.10 ACM codec support
  • DSP Group TrueSpeech ACM codec support
  • Fully managed G.711 a-law and mu-law codecs (encode & decode)
  • Fully managed G.722 codec (encode & decode)
  • Example of integration with NSpeex
  • Fix to PlaybackStopped using SyncContext for thread safety
  • Obsoleted IWavePlayer.Volume (can still set volume on WaveOut directly if you want)
  • Improved FFT display in WPF demo
  • WaveFileReader - tolerate junk after data chunk
  • WaveOut constructor detects if no sync context & choose func callbacks
  • WaveOut function mode callbacks hopefully chased out the last of the hanging bugs (if in a WaveOutWrite at same time as WaveOutReset, bad things happen - so need locks, but if WaveOutReset called during a previous func callback that is about to call waveOutWrite we deadlock)
  • Now has an msbuild script allowing me to more easily create releases, run tests etc
  • Now using Mercurial for source control, hopefully making bug fixing old releases and accepting user patches easier. n.b. this unfortunately means all old submitted patches are no longer available for download on the CodePlex page
  • WPF Demo enhancements
  • WPF Demo is now .NET 4, allowing us to use MEF, and will be updated hopefully with more examples of using NAudio
  • WPF Demo uses windowing before FFT for a more accurate spectrum plot
  • WPF Demo has visualization plugins, allowing me to trial different drawing mechanisms
  • WPF Demo has a (very basic) drum machine example

New in NAudio 1.4 RC (Apr 9, 2012)

  • 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 WaveFormatConversionStream might stop working – another reason to stay targetting 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 WaveFormatConversionStream or a BlockAlignReductionStream
  • More examples IWaveProvider implementers have been added, including the particularly useful BufferedWaveProvider which allows you to queue up buffers to be played on demand
  • BufferedWaveProvider
  • Wave16toFloatProvider
  • WaveFloatTo16Provider
  • WaveInProvider
  • MonoToStereoProvider16
  • StereoToMonoProvider16
  • WaveRecorder
  • 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 WaveOut, DirectSoundOut, WasapiOut and AsioOut
  • WaveChannel32 can 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
  • AsioOut more reliable, although I still think there are more issues to be teased out. Please report whether it works on your hardware
  • WaveFileReader and WaveFileWriter support for 24 and 32 bit samples
  • Allow arbitrary chunks to appear before fmt chunk in a WAV file
  • Reading and writing WAV files with Cues
  • Obsoleted some old WaveFileWriter and WaveFileReader methods
  • Fixed a longstanding issue with WaveOutReset hanging in function callbacks on certain chipsets
  • Added sequencer specific MIDI event
  • RawWaveSourceStream turns a raw audio data stream into a WaveStream with specified WaveFormat
  • A DMO MP3 Frame Decoder as an alternative to the ACM one
  • Easier selection of DirectSound output device
  • WaveOut uses 2 buffers not 3 by default now (a leftover from the original days of NAudio when my PC had a 400MHz Pentium II processor!)

New in NAudio 1.3 Beta (Jan 10, 2010)

  • WaveOut has a new constructor (this is breaking change), which allows three options for waveOut callbacks. This is because there is no “one size fits all” solution, but if you are creating WaveOut on the GUI thread of a Winforms or WPF application, then the default constructor should work just fine. WaveOut also allows better flexibility over controlling the number of buffers and desired latency.
  • Mp3FileReader and WaveFileReader can have a stream as input, and WaveFileWriter can write to a stream. These features are useful to those wanting to stream data over networks.
  • The new IWaveProvider interface is like a lightweight WaveStream. It doesn’t support repositioning or length and current position reporting, making the implementation of synthesizers much simpler. The IWavePlayer interface takes an IWaveProvider rather than WaveStream. WaveStream implements IWaveProvider, so existing code continues to work just fine.
  • Added in LoopStream, WaveProvider32 and WaveProvider16 helper classes. Expect more to be built upon these in the future.
  • I have also started using the WaveBuffer class. This clever idea from Alexandre Mutel allows us to trick the .NET type system into letting us cast from byte[] to float[] or 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.
  • The WaveIn support has been updated and enhanced. WaveInStream is 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).