Table of Contents

Class MediaFoundationTransform

Namespace
NAudio.MediaFoundation
Assembly
NAudio.Wasapi.dll

An abstract base class for simplifying working with Media Foundation Transforms. You need to override the method that actually creates and configures the transform.

public abstract class MediaFoundationTransform : IWaveProvider, IDisposable
Inheritance
MediaFoundationTransform
Implements
Derived
Inherited Members
Extension Methods

Constructors

MediaFoundationTransform(IWaveProvider, WaveFormat)

Constructs a new MediaFoundationTransform wrapper. Uses a short input chunk size to balance latency and throughput.

public MediaFoundationTransform(IWaveProvider sourceProvider, WaveFormat outputFormat)

Parameters

sourceProvider IWaveProvider

The source provider for input data to the transform

outputFormat WaveFormat

The desired output format

Fields

outputWaveFormat

The Output WaveFormat

protected readonly WaveFormat outputWaveFormat

Field Value

WaveFormat

sourceProvider

The Source Provider

protected readonly IWaveProvider sourceProvider

Field Value

IWaveProvider

Properties

WaveFormat

The output WaveFormat of this Media Foundation Transform

public WaveFormat WaveFormat { get; }

Property Value

WaveFormat

Methods

Dispose()

Disposes this Media Foundation Transform

public void Dispose()

Dispose(bool)

Disposes this MediaFoundation transform

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Read(Span<byte>)

Reads data out of the source, passing it through the transform

public int Read(Span<byte> buffer)

Parameters

buffer Span<byte>

Returns

int

Reposition()

Indicate that the source has been repositioned and completely drain out the transforms buffers

public void Reposition()