Back to Naudio

NAudio.Wasapi

src/NAudio.Wasapi/README.md

3.0.11.9 KB
Original Source

NAudio.Wasapi

WASAPI and Media Foundation support for NAudio. Targets net9.0 and is Windows-only at runtime (guarded by [SupportedOSPlatform("windows")]), so cross-platform apps can reference it and build on any OS without EnableWindowsTargeting. Live WinRT MIDI moved to the NAudio.Midi package.

What's included

  • WASAPI playbackWasapiOut (shared and exclusive mode, event-driven callbacks), plus the modern WasapiPlayer / WasapiPlayerBuilder
  • WASAPI captureWasapiCapture for microphone/line-in capture, WasapiLoopbackCapture for system audio, plus the modern WasapiRecorder / WasapiRecorderBuilder
  • Device enumerationMMDeviceEnumerator, MMDevice, per-device volume, mute, peak/RMS metering, notification callbacks
  • Media FoundationMediaFoundationReader and MediaFoundationEncoder for MP3, AAC/MP4, WMA and any installed MFT codec; MediaFoundationResampler
  • Audio Session API — per-session volume, mute, and metering

For DMO effects (echo, chorus, reverb, etc.), the DMO MP3 decoder, the DMO resampler, and DirectSoundOut, see the separate NAudio.Dmo package.

When to use it

Use this package whenever you want modern Windows audio APIs: low-latency playback, loopback capture of the system mixer, per-application volume, or codec support via Media Foundation. The package is being actively modernized to use GeneratedComInterface and source-generated COM interop.

See the NAudio documentation site for tutorials and the full API reference, or the GitHub repository for full documentation and tutorials.

License

MIT.