Xeno-rat
Loading...
Searching...
No Matches
NAudio.Wave.StreamMediaFoundationReader Class Reference

MediaFoundationReader supporting reading from a stream. More...

Inheritance diagram for NAudio.Wave.StreamMediaFoundationReader:
Collaboration diagram for NAudio.Wave.StreamMediaFoundationReader:

Public Member Functions

 StreamMediaFoundationReader (Stream stream, MediaFoundationReaderSettings settings=null)
 Constructs a new media foundation reader from a stream.
 
- Public Member Functions inherited from NAudio.Wave.MediaFoundationReader
 MediaFoundationReader (string file)
 Creates a new MediaFoundationReader based on the supplied file.
 
 MediaFoundationReader (string file, MediaFoundationReaderSettings settings)
 Creates a new MediaFoundationReader based on the supplied file.
 
override int Read (byte[] buffer, int offset, int count)
 Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
 
- Public Member Functions inherited from NAudio.Wave.WaveStream
override void Flush ()
 Flushes the buffer of the current stream and causes any buffered data to be written to the underlying device.
 
override long Seek (long offset, SeekOrigin origin)
 Sets the position within the current stream.
 
override void SetLength (long length)
 Throws a NotSupportedException with the message "Can't set length of a WaveFormatString".
 
override void Write (byte[] buffer, int offset, int count)
 Throws a NotSupportedException with the message "Can't write to a WaveFormatString".
 
void Skip (int seconds)
 Skips the playback to a new position in the audio file based on the specified number of seconds.
 
virtual bool HasData (int count)
 Checks if there is data available at the current position.
 

Protected Member Functions

override IMFSourceReader CreateReader (MediaFoundationReaderSettings settings)
 Creates a new instance of IMFSourceReader with the specified settings.
 
- Protected Member Functions inherited from NAudio.Wave.MediaFoundationReader
 MediaFoundationReader ()
 Default constructor.
 
void Init (MediaFoundationReaderSettings initialSettings)
 Initializes the MediaFoundationReader with the specified settings.
 
override void Dispose (bool disposing)
 Releases the unmanaged resources used by the ClassName and optionally releases the managed resources.
 

Private Attributes

readonly Stream stream
 

Additional Inherited Members

- Properties inherited from NAudio.Wave.MediaFoundationReader
override WaveFormat WaveFormat [get]
 WaveFormat of this stream (n.b. this is after converting to PCM)
 
override long Length [get]
 The bytesRequired of this stream in bytes (n.b may not be accurate)
 
override long Position [get, set]
 Current position within this stream.
 
- Properties inherited from NAudio.Wave.WaveStream
WaveFormat WaveFormat [get]
 Retrieves the WaveFormat for this stream.
 
override bool CanRead [get]
 We can read from this stream.
 
override bool CanSeek [get]
 We can seek within this stream.
 
override bool CanWrite [get]
 We can't write to this stream.
 
virtual int BlockAlign [get]
 The block alignment for this wavestream. Do not modify the Position to anything that is not a whole multiple of this value.
 
virtual TimeSpan CurrentTime [get, set]
 The current position in the stream in Time format.
 
virtual TimeSpan TotalTime [get]
 Total length in real-time of the stream (may be an estimate for compressed files)
 
- Properties inherited from NAudio.Wave.IWaveProvider
- Events inherited from NAudio.Wave.MediaFoundationReader
EventHandler WaveFormatChanged
 WaveFormat has changed.
 

Detailed Description

MediaFoundationReader supporting reading from a stream.

Constructor & Destructor Documentation

◆ StreamMediaFoundationReader()

NAudio.Wave.StreamMediaFoundationReader.StreamMediaFoundationReader ( Stream stream,
MediaFoundationReaderSettings settings = null )
inline

Constructs a new media foundation reader from a stream.

Here is the call graph for this function:

Member Function Documentation

◆ CreateReader()

override IMFSourceReader NAudio.Wave.StreamMediaFoundationReader.CreateReader ( MediaFoundationReaderSettings settings)
inlineprotectedvirtual

Creates a new instance of IMFSourceReader with the specified settings.

Parameters
settingsThe settings for the new IMFSourceReader instance.
Returns
A new instance of IMFSourceReader configured based on the provided settings.

This method creates a new IMFSourceReader from the byte stream created using the provided stream. It then sets the stream selection for audio and video, and configures the current media type for audio based on the specified settings.

Reimplemented from NAudio.Wave.MediaFoundationReader.

Here is the call graph for this function:

Member Data Documentation

◆ stream

readonly Stream NAudio.Wave.StreamMediaFoundationReader.stream
private

The documentation for this class was generated from the following file: