public abstract class DmoStream : IWaveSource
Base class for all Dmo based streams.
InputIndex
The default inputStreamIndex to use.
protected readonly Int32 InputIndex
OutputIndex
The default outputStreamIndex to use.
protected readonly Int32 OutputIndex
DmoStream()
Base class for all Dmo based streams.
protected void DmoStream()
CreateMediaObject(WaveFormat inputFormat, WaveFormat outputFormat)
Creates and returns a new MediaObject instance to use for processing audio data. This can be a decoder, effect, ...
protected abstract MediaObject CreateMediaObject(WaveFormat inputFormat, WaveFormat outputFormat)
Parameters
inputFormat
WaveFormatThe input format of the MediaObject to create.
outputFormat
WaveFormatThe output format of the MediaObject to create.
Returns
The created MediaObject to use for processing audio data.
Dispose()
Disposes the DmoStream.
public void Dispose()
Dispose(Boolean disposing)
Releases the DmoStream.
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 DmoStream class.
protected void Finalize()
GetInputData(Byte[]& inputDataBuffer, Int32 requested)
Gets inputData to feed the Dmo MediaObject with.
protected abstract Int32 GetInputData(Byte[]& inputDataBuffer, Int32 requested)
Parameters
inputDataBuffer
Byte[]&InputDataBuffer which receives the inputData. If this parameter is null or the length is less than the amount of inputData, a new byte array will be applied.
requested
Int32The requested number of bytes.
Returns
The number of bytes read. The number of actually read bytes does not have to be the number of requested bytes.
GetInputFormat()
Gets the input format to use.
protected abstract WaveFormat GetInputFormat()
Returns
The input format.
GetOutputFormat()
Gets the output format to use.
protected abstract WaveFormat GetOutputFormat()
Returns
The output format.
Initialize()
Initializes the DmoStream. Important: This has to be called before using the DmoStream.
InputToOutput(Int64 position)
Converts a position of the inputstream to the equal position in the outputstream.
protected virtual Int64 InputToOutput(Int64 position)
Parameters
position
Int64Any position/offset of the inputstream, in bytes.
Returns
Position in the outputstream, in bytes.
OutputToInput(Int64 position)
Translates a position of the outputstream to the equal position in the inputstream.
protected virtual Int64 OutputToInput(Int64 position)
Parameters
position
Int64Any position/offset of the outputstream, in bytes.
Returns
Position in the inputstream, in bytes.
Read(Byte[] buffer, Int32 offset, Int32 count)
Reads a sequence of bytes from the stream.
public virtual Int32 Read(Byte[] buffer, Int32 offset, Int32 count)
Parameters
buffer
Byte[]An array of bytes. When this method returns, the buffer contains the read bytes.
offset
Int32The zero-based byte offset in buffer at which to begin storing the data read from the stream.
count
Int32The maximum number of bytes to be read from the stream
Returns
The actual number of read bytes.
ResetOverflowBuffer()
Resets the overflowbuffer.
protected void ResetOverflowBuffer()
CanSeek
Gets a value indicating whether the IAudioSource supports seeking.
public abstract Boolean CanSeek { get; }
InputFormat
Gets the input format of the DmoStream.
public WaveFormat InputFormat { get; }
Length
Gets the length of the stream.
public abstract Int64 Length { get; }
Position
Gets or sets the position of the stream.
public abstract Int64 Position { get; set; }
WaveFormat
Gets the output format of the DmoStream.
public WaveFormat WaveFormat { get; }