public class MediaFoundationDecoder : IWaveSource
The MediaFoundationDecoder is a generic decoder for all installed Mediafoundation codecs.
MediaFoundationDecoder(MFByteStream byteStream)
Initializes a new instance of the MediaFoundationDecoder class.
public void MediaFoundationDecoder(MFByteStream byteStream)
Parameters
byteStream
MFByteStreamStream which provides the audio data to decode.
MediaFoundationDecoder(Stream stream)
Initializes a new instance of the MediaFoundationDecoder class.
public void MediaFoundationDecoder(Stream stream)
Parameters
stream
StreamStream which provides the audio data to decode.
MediaFoundationDecoder(String url)
Initializes a new instance of the MediaFoundationDecoder class.
public void MediaFoundationDecoder(String url)
Parameters
url
StringUri which points to an audio source which can be decoded.
Dispose()
Disposes the MediaFoundationDecoder.
public void Dispose()
Dispose(Boolean disposing)
Disposes the MediaFoundationDecoder and its internal resources.
protected virtual void Dispose(Boolean disposing)
Parameters
disposing
BooleanTrue to release both managed and unmanaged resources; false to release only unmanaged resources.
Finalize()
Finalizes an instance of the MediaFoundationDecoder class.
protected void Finalize()
Read(Byte[] buffer, Int32 offset, Int32 count)
Reads a sequence of bytes from the MediaFoundationDecoder and advances the position within the stream by the number of bytes read.
public Int32 Read(Byte[] buffer, Int32 offset, Int32 count)
Parameters
buffer
Byte[]An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
offset
Int32The zero-based byte offset in the buffer at which to begin storing the data read from the current stream.
count
Int32The maximum number of bytes to read from the current source.
Returns
The total number of bytes read into the buffer.
CanSeek
Gets a value which indicates whether the seeking is supported. True means that seeking is supported. False means that seeking is not supported.
public Boolean CanSeek { get; }
Length
Gets the total length of the decoded audio, in bytes.
public Int64 Length { get; }
Position
Gets or sets the position of the output stream, in bytes.
public Int64 Position { get; set; }
WaveFormat
Gets the format of the decoded audio data provided by the Read method.
public WaveFormat WaveFormat { get; }