Namespace NAudio.Wave
Namespaces
Classes
- AcmMp3FrameDecompressor
MP3 Frame Decompressor using ACM
- AdpcmWaveFormat
Microsoft ADPCM See http://icculus.org/SDL_sound/downloads/external_documentation/wavecomp.htm
- AiffFileReader
A read-only stream of AIFF data based on an aiff file with an associated WaveFormat originally contributed to NAudio by Giawa
- AiffFileWriter
This class writes audio data to a .aif file on disk
- AsioAudioAvailableEventArgs
Raised when ASIO data has been recorded. It is important to handle this as quickly as possible as it is in the buffer callback
- AsioAudioCapturedEventArgs
Event args for AudioCaptured. Exposes one converted float span per selected input channel, plus a zero-copy raw escape hatch. Valid only for the duration of the event handler invocation.
- AsioDevice
High-level wrapper for an ASIO driver. Configurable into one of three mutually-exclusive modes: playback (InitPlayback(AsioPlaybackOptions)), recording (InitRecording(AsioRecordingOptions)), or duplex processing (InitDuplex(AsioDuplexOptions)).
- AsioDuplexOptions
Options for configuring an AsioDevice in duplex mode via InitDuplex(AsioDuplexOptions). Duplex mode runs a user-supplied AsioProcessCallback that reads input and writes output in a single buffer-switch callback.
- AsioOut
ASIO Out Player — the original NAudio 2.x entry point for ASIO playback, recording, and duplex. Implemented in NAudio 3 as a thin facade over AsioDevice: lifecycle, capabilities, drain-on-dispose, and synchronization-context dispatch all flow through that class, while AsioOut keeps its raw
IntPtr-based AudioAvailable contract for back-compat consumers.
- AsioPlaybackOptions
Options for configuring an AsioDevice in playback-only mode via InitPlayback(AsioPlaybackOptions).
- AsioRecordingOptions
Options for configuring an AsioDevice in recording-only mode via InitRecording(AsioRecordingOptions).
- AudioFileReader
AudioFileReader simplifies opening an audio file in NAudio Simply pass in the filename, and it will attempt to open the file and set up a conversion path that turns into PCM IEEE float. ACM codecs will be used for conversion. It provides a volume property and implements both WaveStream and ISampleProvider, making it possibly the only stage in your audio pipeline necessary for simple playback scenarios
- AudioMediaSubtypes
Audio Media Subtypes
- BextInterpreter
IWaveChunkInterpreter<T> that parses the
bext(Broadcast Wave Format) chunk. Returnsnullif nobextchunk is present.
- BlockAlignReductionStream
Helper stream that lets us read from compressed audio files with large block alignment as though we could read any amount and reposition anywhere
- BroadcastExtension
Parsed contents of a Broadcast Wave Format
bextchunk. See https://tech.ebu.ch/docs/tech/tech3285.pdf for the full specification.
- BufferedWaveProvider
Provides a buffered store of samples. Read method will return queued samples or fill buffer with zeroes. Backed by a circular buffer.
- CoreAudioCaptureBuffer
Provides a buffer containing data captured from a CoreAudioRecorder instance.
- CoreAudioPlayer
Provides an audio player based on the Apple's audio HAL framework library, namely the Core Audio Framework.
The user provides the audio device to perform playback upon, the audio provider to do playback for, and the rest are managed by this class. This class does also manage cases where the streams may be invalidated, or when the selected stream's virtual format has been changed.
There are also several properties that can be configured by the provided AudioDevice object during construction (applying to all the attached players of the device). See the AudioDevice properties and methods to see what can be configured.
- CoreAudioRecorder
Provides a way to capture data from an audio device based on the Apple's audio HAL framework library, namely the Core Audio Framework.
The user provides the audio device to perform recording upon and the rest are managed by this class. This class does also manage cases where the streams may be invalidated, or when the selected stream's virtual format has been changed, for which cases the recorder will dispatch the CaptureFormatChanged event.
There are also several properties that can be configured by the provided AudioDevice object during construction (applying to all the attached recorders of the device). See the AudioDevice properties and methods to see what can be configured.
- Cue
Holds information on a cue: a labeled position within a Wave file
- CueList
Holds a list of cues
- CueListInterpreter
IWaveChunkInterpreter<T> that reads the
cueand companionLIST/adtlchunks from a WAV file and returns a CueList. Returnsnullonly when nocuechunk is present. When acuechunk exists without a companionLIST/adtllabel chunk, the cues are returned with empty labels.
- DirectSoundDeviceInfo
Class for enumerating DirectSound devices
- DirectSoundException
Exception thrown by DirectSound API operations. Inherits from COMException for backwards compatibility with code that catches COMException from the legacy
[ComImport]path (which auto-threw on failure HRESULTs viaPreserveSig=false). The[GeneratedComInterface]migration moved DirectSound to explicit[PreserveSig] int-returning slots, so HRESULT inspection is now done via ThrowIfFailed(int).
- DirectSoundOut
NativeDirectSoundOut using DirectSound COM interop. Contact author: Alexandre Mutel - alexandre_mutel at yahoo.fr Modified by: Graham "Gee" Plumb
- DmoEffectWaveProvider<TDmoEffector, TEffectorParam>
Applies DMO effects to an audio source in real time.
If the audio thread is running on the STA thread, please generate and operate from the same thread. If the audio thread is running on the MTA thread, please operate on any MTA thread.
- ExtendedAudioFileReaderFromStream
Provides the ability to decode and read files from data streams.
The reader does the best effort to decode to PCM - as such, all the audio file data that you will recieve will not ever be compressed formats.
Unlike the ExtendedAudioFileReaderFromURL class, it requires to set up either a MIME type or a file extension to be able to better recognize the data stream.
Uses the Audio Toolbox framework Extended Audio File Services API.
- ExtendedAudioFileReaderFromStream.ExtendedAudioFileReaderFromStreamSettings
Provides additional settings pertaining only to ExtendedAudioFileReaderFromStream instances.
- ExtendedAudioFileReaderFromURL
Provides the ability to decode and read files from URL paths.
The reader does the best effort to decode to PCM - as such, all the audio file data that you will recieve will not ever be compressed formats.
Uses the Audio Toolbox framework Extended Audio File Services API.
- ExtendedAudioFileWriter
Provides a writer that can create audio files.
Uses the Audio Toolbox framework Extended Audio File Services API to write the file.
- Gsm610WaveFormat
GSM 610
- Id3v2Tag
An ID3v2 Tag
- InfoListInterpreter
IWaveChunkInterpreter<T> that parses the
LIST/INFOchunk. Returnsnullif no INFO list is present. If multiple LIST chunks are present (e.g. anadtllist for cue labels alongside anINFOlist), the INFO list is located by its type header.
- InfoMetadata
Parsed contents of a
LISTchunk with typeINFO— the standard RIFF metadata container (artist, title, copyright, etc.). Use the named properties for common tags, or this[string] / Contains(string) to access arbitrary four-character INFO subchunk ids. Also writable: construct, Set(string, string) entries, then serialise via WriteInfoMetadata(WaveFileWriter, InfoMetadata, ChunkPosition).
- MacAudioConverter
Provides the platform's resampler.
Has almost the same strengths as the Windows Media Resampler (excluding changing the input provider's audio format details on the fly), and even provides more options compared to that one, allowing to select resampling algorithm, quality and dithering.
- MediaFoundationEncoder
Media Foundation Encoder class allows you to use Media Foundation to encode an IWaveProvider to any supported encoding format
- MediaFoundationReader
Class for reading any file that Media Foundation can play Automatically converts to PCM If it is a video file with multiple audio streams, it will pick out the first audio stream
- MediaFoundationReader.MediaFoundationReaderSettings
Allows customisation of this reader class
- MediaFoundationResampler
The Media Foundation Resampler Transform
- MonoToStereoProvider16
Converts from mono to stereo, allowing freedom to route all, some, or none of the incoming signal to left or right channels
- Mp3FileReader
Class for reading from MP3 files
- Mp3FileReaderBase
Class for reading from MP3 files
- Mp3Frame
Represents an MP3 Frame
- Mp3WaveFormat
MP3 WaveFormat, MPEGLAYER3WAVEFORMAT from mmreg.h
- MultiplexingWaveProvider
Allows any number of inputs to be patched to outputs Uses could include swapping left and right channels, turning mono into stereo, feeding different input sources to different soundcard outputs etc
- RawSourceWaveStream
WaveStream that simply passes on data from its source stream (e.g. a MemoryStream)
- ResamplerDmoStream
Wave Stream for converting between sample rates
- RiffChunk
Holds information about a RIFF file chunk
- SampleEventArgs
Sample event arguments
- SampleProviderBase
Base class for creating an ISampleProvider by overriding a
Read(float[], int, int)method instead of Read(Span<float>). Like WaveProvider32 it also implements IWaveProvider, so a derived class can be passed straight to an IWavePlayer.
- SilenceProvider
Silence producing wave provider Useful for playing silence when doing a WASAPI Loopback Capture
- StereoToMonoProvider16
Takes a stereo 16 bit input and turns it mono, allowing you to select left or right channel only or mix them together
- StoppedEventArgs
Stopped Event Args
- StreamMediaFoundationReader
MediaFoundationReader supporting reading from a stream
Automatically converts to PCM.
If it is a video file with multiple audio streams, it will pick out the first audio stream.
- TrueSpeechWaveFormat
DSP Group TrueSpeech
- VolumeWaveProvider16
Helper class allowing us to modify the volume of a 16 bit stream without converting to IEEE float
- WasapiLoopbackCapture
WASAPI Loopback Capture based on a contribution from "Pygmy"
- WasapiOut
Support for playback using Wasapi
- WasapiPlaybackCapability
Describes what Init(IWaveProvider) would do for a particular source format, as returned by GetPlaybackCapability(WaveFormat). Lets you validate a chosen configuration before opening the audio stream.
- WasapiPlayer
Modern WASAPI audio player with zero-copy buffer access, MMCSS thread priority, and IAudioClient3 low-latency support. Created via WasapiPlayerBuilder.
- WasapiPlayerBuilder
Fluent builder for creating a WasapiPlayer.
- WasapiRecorder
Modern WASAPI audio recorder with zero-copy buffer access, MMCSS thread priority, process-specific loopback capture, and IAsyncEnumerable support. Created via WasapiRecorderBuilder.
- WasapiRecorderBuilder
Fluent builder for creating a WasapiRecorder.
- Wave16ToFloatProvider
Converts 16 bit PCM to IEEE float, optionally adjusting volume along the way
- Wave32To16Stream
WaveStream that converts 32 bit audio back down to 16 bit, clipping if necessary
- WaveBuffer
WaveBuffer class use to store wave datas. Data can be manipulated with arrays (ByteBuffer,FloatBuffer,ShortBuffer,IntBuffer ) that are pointing to the same memory buffer. Use the associated Count property based on the type of buffer to get the number of data in the buffer. Implicit casting is now supported to float[], byte[], int[], short[]. You must not use Length on returned arrays.
n.b. FieldOffset is 8 now to allow it to work natively on 64 bit
- WaveCapabilitiesHelpers
Wave Capabilities Helpers
- WaveChannel32
Represents Channel for the WaveMixerStream 32 bit output and 16 bit input It's output is always stereo The input stream can be panned
- WaveChunks
A read-only view of the non-essential RIFF chunks found in a WAV file (everything except the
fmtanddatachunks, which are handled directly by WaveFileReader).Chunk metadata (id, length, stream position) is materialised when the file is opened; chunk contents are read lazily via GetData(RiffChunk) or an IWaveChunkInterpreter<T>.
- WaveChunksExtensions
Convenience extension methods over WaveChunks for NAudio's built-in chunk interpreters. Each extension simply invokes the corresponding
IWaveChunkInterpreter<T>.Instance— users can write their own interpreters (or extension methods) following the same pattern.
- WaveExtensionMethods
Useful extension methods to make switching between WaveAndSampleProvider easier
- WaveFileReader
This class supports the reading of WAV files, providing a repositionable WaveStream that returns the raw data contained in the WAV file
- WaveFileWriter
This class writes WAV data to a .wav file on disk
- WaveFileWriterExtensions
Convenience extension methods over WaveFileWriter for NAudio's built-in chunk writers. Each extension serialises a strongly-typed object and calls AddChunk(string, byte[], ChunkPosition). Users can write their own similar extensions for additional chunk types.
- WaveFileWriterOptions
Optional configuration for WaveFileWriter. All properties are
init-only so the captured configuration is immutable for the lifetime of the writer.
- WaveFloatTo16Provider
Converts IEEE float to 16 bit PCM, optionally clipping and adjusting volume along the way
- WaveFormat
Represents a Wave file format
- WaveFormatConversionProvider
IWaveProvider that passes through an ACM Codec
- WaveFormatConversionStream
WaveStream that passes through an ACM Codec
- WaveFormatExtensible
WaveFormatExtensible http://www.microsoft.com/whdc/device/audio/multichaud.mspx
- WaveFormatExtraData
A WaveFormat that keeps the format-specific extra bytes (cbSize) it was read with, without interpreting them. Reading a WAV fmt chunk produces one of these, and MarshalFromPtr(nint) falls back to it for an encoding NAudio has no dedicated subclass for.
- WaveIn
WaveIn recording device using event callbacks
- WaveInEvent
Obsolete: use WaveIn instead (renamed from WaveInEvent to WaveIn in NAudio 3.0)
- WaveInEventArgs
Event args for a recording callback. Carries one chunk of captured PCM data.
- WaveInProvider
Buffered IWaveProvider taking source data from WaveIn
- WaveInWindow
Records audio using the winmm
waveInAPI with CALLBACK_WINDOW, delivering the DataAvailable event on the UI thread's message pump. Useful for apps that want recording callbacks to arrive on the UI thread without any manual marshaling. For background-thread capture use WaveIn in the NAudio.WinMM package instead.
- WaveMixerStream32
WaveStream that can mix together multiple 32 bit input streams (Normally used with stereo input channels) All channels must have the same number of inputs
- WaveOffsetStream
Simply shifts the input stream in time, optionally clipping its start and end. (n.b. may include looping in the future)
- WaveOut
WaveOut playback device using event callbacks
- WaveOutEvent
Obsolete: use WaveOut instead (renamed from WaveOutEvent to WaveOut in NAudio 3.0)
- WaveOutWindow
Plays audio using the winmm
waveOutAPI with CALLBACK_WINDOW, so that buffer-done notifications are delivered on the UI thread's message pump. Useful when you want PlaybackStopped and internal buffer recycling to happen on the UI thread without any manual marshaling. For background-thread playback use WaveOut in the NAudio.WinMM package instead.
- WaveProvider16
Base class for creating a 16 bit wave provider
- WaveProvider32
Base class for creating a 32 bit floating point wave provider Can also be used as a base class for an ISampleProvider that can be plugged straight into anything requiring an IWaveProvider
- WaveProviderBase
Base class for creating an IWaveProvider of any format by overriding a
Read(byte[], int, int)method instead of Read(Span<byte>).
- WaveRecorder
Utility class to intercept audio from an IWaveProvider and save it to disk
- WaveStream
Base class for all WaveStream classes. Derives from stream.
- XingHeader
Represents a Xing VBR header
Structs
- AiffFileReader.AiffChunk
AIFF Chunk
- AsioProcessBuffers
Per-callback view of input and output audio for a duplex AsioDevice session. Passed by reference to the user's AsioProcessCallback.
- AsioRawInputBuffer
Zero-copy read-only view of a single ASIO input channel in the driver's native format. Obtained via RawInput(int) or RawInput(int).
- AsioRawOutputBuffer
Zero-copy writable view of a single ASIO output channel in the driver's native format. Obtained via RawOutput(int).
- AsioTimeCodeInfo
SMPTE/MTC time code reported by the ASIO driver for the current buffer. Surfaced on TimeCode and TimeCode when the driver is receiving an external time-code source (LTC input, MTC over MIDI, etc.).
- AudioBuffer
A captured audio buffer suitable for async consumption (heap-allocated copy).
- WaveInCapabilities
WaveInCapabilities structure (based on WAVEINCAPS2 from mmsystem.h) http://msdn.microsoft.com/en-us/library/ms713726(VS.85).aspx
- WaveOutCapabilities
WaveOutCapabilities structure (based on WAVEOUTCAPS2 from mmsystem.h) http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_waveoutcaps_str.asp
Interfaces
- IMp3FrameDecompressor
Interface for MP3 frame by frame decoder
- ISampleNotifier
An interface for WaveStreams which can report notification of individual samples
- ISampleProvider
Like IWaveProvider, but makes it much simpler to put together a 32 bit floating point mixing engine
- IWaveBuffer
IWaveBuffer interface use to store wave datas. Data can be manipulated with arrays (ByteBuffer,FloatBuffer, ShortBuffer,IntBuffer ) that are pointing to the same memory buffer. This is a requirement for all subclasses.
Use the associated Count property based on the type of buffer to get the number of data in the buffer.
WaveBuffer for the standard implementation using C# unions.
- IWaveChunkInterpreter<T>
Converts one or more raw RIFF chunks into a strongly-typed view. Implementations are typically stateless; expose a
public static readonlyinstance and call it via Read<T>(IWaveChunkInterpreter<T>).
- IWaveChunkWriter
Writes a single RIFF chunk into a WaveFileWriter. Implementations are typically stateless; see WaveFileWriterExtensions for the built-in
Write*helpers.
- IWaveIn
Generic interface for wave recording
- IWaveLatency
Interface for audio players and captures that can report the latency between a sample entering the audio pipeline and emerging from (or being delivered by) the hardware. Implement alongside IWavePlayer or IWaveIn to let downstream code synchronise visualisations, lighting, video, recording timecode, or any other time-aligned consumer with audible output or captured input.
- IWavePlayer
Represents the interface to a device that can play a WaveFile
- IWavePosition
Interface for IWavePlayers that can report position
- IWaveProvider
Generic interface for all WaveProviders.
Enums
- AsioDeviceState
Lifecycle states for an AsioDevice.
- CaptureState
Represents state of a capture device
- ChannelMode
Channel Mode
- ChunkPosition
Whether an extra RIFF chunk is written before the
datachunk (inside the RIFF header section) or after it (appended once data has been finalised).
- Mp3WaveFormatFlags
Wave Format Padding Flags
- Mp3WaveFormatId
Wave Format ID
- MpegLayer
MPEG Layer flags
- MpegVersion
MPEG Version Flags
- PlaybackState
Playback State
- Speakers
Speaker position flags used to build the
dwChannelMaskof a WaveFormatExtensible. The values match theSPEAKER_*constants from the Windowsksmedia.hheader, so a combination of these flags can be passed directly as a channel mask.
- SupportedWaveFormat
Supported wave formats for WaveOutCapabilities
- WaveFormatEncoding
Summary description for WaveFormatEncoding.
Delegates
- AsioProcessCallback
User-supplied processing callback for InitDuplex(AsioDuplexOptions). Called once per ASIO buffer-switch with a stack-only view of input and output channels.
- CaptureDataAvailableHandler
Delegate for zero-copy capture data events. The buffer is a ReadOnlySpan<T> directly over the WASAPI buffer — only valid for the duration of the callback.
- CoreAudioCaptureDataAvailableHandler
Provides an event handler that provides the audio data captured by a CoreAudioCapture instance.
- CoreAudioCaptureFormatChangedHandler
Provides a delegate that is invoked when the capture format of the specified Core Audio recorder changes.
- Mp3FileReaderBase.FrameDecompressorBuilder
Function that can create an MP3 Frame decompressor