WaveStream that passes through an ACM Codec.
More...
|
| WaveFormatConversionStream (WaveFormat targetFormat, WaveStream sourceStream) |
| Create a new WaveFormat conversion stream.
|
|
int | SourceToDest (int source) |
| Estimates the destination value from the given source value.
|
|
int | DestToSource (int dest) |
| Converts the destination value to the source value using the EstimateDestToSource method and returns the result.
|
|
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.
|
|
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.
|
|
|
override void | Dispose (bool disposing) |
| Releases the unmanaged resources used by the WaveFormatConversionStream and optionally releases the managed resources.
|
|
|
override long | Position [get, set] |
| Gets or sets the current position in the stream.
|
|
override long | Length [get] |
| Returns the stream length.
|
|
override WaveFormat | WaveFormat [get] |
| Gets the WaveFormat of this stream.
|
|
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)
|
|
|
long | EstimateSourceToDest (long source) |
| Estimates the destination position based on the source position.
|
|
long | EstimateDestToSource (long dest) |
| Estimates the source position corresponding to the given destination position.
|
|
WaveStream that passes through an ACM Codec.
◆ WaveFormatConversionStream()
NAudio.Wave.WaveFormatConversionStream.WaveFormatConversionStream |
( |
WaveFormat | targetFormat, |
|
|
WaveStream | sourceStream ) |
|
inline |
Create a new WaveFormat conversion stream.
- Parameters
-
targetFormat | Desired output format |
sourceStream | Source stream |
◆ CreatePcmStream()
Creates a PCM stream from the given source stream.
- Parameters
-
sourceStream | The input wave stream. |
- Returns
- A PCM stream converted from the sourceStream .
- Exceptions
-
InvalidOperationException | Thrown when the suggested output format is invalid and no target format is explicitly provided. |
◆ DestToSource()
int NAudio.Wave.WaveFormatConversionStream.DestToSource |
( |
int | dest | ) |
|
|
inline |
Converts the destination value to the source value using the EstimateDestToSource method and returns the result.
- Parameters
-
dest | The destination value to be converted to the source value. |
- Returns
- The converted source value from the given dest .
- Exceptions
-
ObsoleteException | This method is obsolete and can be unreliable. Use of this method is not encouraged. |
◆ Dispose()
override void NAudio.Wave.WaveFormatConversionStream.Dispose |
( |
bool | disposing | ) |
|
|
inlineprotected |
Releases the unmanaged resources used by the WaveFormatConversionStream and optionally releases the managed resources.
- Parameters
-
disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
- Exceptions
-
ObjectDisposedException | Thrown if the WaveFormatConversionStream has already been disposed. |
This method releases the unmanaged resources used by the WaveFormatConversionStream and optionally releases the managed resources. If disposing is true, this method disposes the sourceStream and conversionProvider. If disposing is false, this method checks if the WaveFormatConversionStream has already been disposed and asserts if not.
◆ EstimateDestToSource()
long NAudio.Wave.WaveFormatConversionStream.EstimateDestToSource |
( |
long | dest | ) |
|
|
inlineprivate |
Estimates the source position corresponding to the given destination position.
- Parameters
-
dest | The destination position for which the corresponding source position needs to be estimated. |
- Returns
- The estimated source position corresponding to the given destination position.
◆ EstimateSourceToDest()
long NAudio.Wave.WaveFormatConversionStream.EstimateSourceToDest |
( |
long | source | ) |
|
|
inlineprivate |
Estimates the destination position based on the source position.
- Parameters
-
source | The source position for estimation. |
- Returns
- The estimated destination position based on the source position.
◆ Read()
override int NAudio.Wave.WaveFormatConversionStream.Read |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
|
inline |
Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
- Parameters
-
buffer | 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 | The zero-based byte offset in buffer at which to begin storing the data read from the current stream. |
count | The maximum number of bytes to be read from the current stream. |
- Returns
- The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream is reached before any bytes are read.
Implements NAudio.Wave.IWaveProvider.
◆ SourceToDest()
int NAudio.Wave.WaveFormatConversionStream.SourceToDest |
( |
int | source | ) |
|
|
inline |
Estimates the destination value from the given source value.
- Parameters
-
source | The source value for estimation. |
- Returns
- The estimated destination value based on the given source .
This method is marked as obsolete and can be unreliable. It is not encouraged to use this method.
◆ conversionProvider
◆ isDisposed
bool NAudio.Wave.WaveFormatConversionStream.isDisposed |
|
private |
◆ length
readonly long NAudio.Wave.WaveFormatConversionStream.length |
|
private |
◆ position
long NAudio.Wave.WaveFormatConversionStream.position |
|
private |
◆ sourceStream
readonly WaveStream NAudio.Wave.WaveFormatConversionStream.sourceStream |
|
private |
◆ targetFormat
readonly WaveFormat NAudio.Wave.WaveFormatConversionStream.targetFormat |
|
private |
◆ Length
override long NAudio.Wave.WaveFormatConversionStream.Length |
|
get |
Returns the stream length.
◆ Position
override long NAudio.Wave.WaveFormatConversionStream.Position |
|
getset |
Gets or sets the current position in the stream.
◆ WaveFormat
override WaveFormat NAudio.Wave.WaveFormatConversionStream.WaveFormat |
|
get |
The documentation for this class was generated from the following file: