WaveStream that can mix together multiple 32 bit input streams (Normally used with stereo input channels) All channels must have the same number of inputs.
More...
|
| WaveMixerStream32 () |
| Creates a new 32 bit WaveMixerStream.
|
|
| WaveMixerStream32 (IEnumerable< WaveStream > inputStreams, bool autoStop) |
| Creates a new 32 bit WaveMixerStream.
|
|
void | AddInputStream (WaveStream waveStream) |
| Adds an input audio stream to the mixer.
|
|
void | RemoveInputStream (WaveStream waveStream) |
| Removes the specified WaveStream from the list of input streams and recalculates the total length of all input streams.
|
|
override int | Read (byte[] buffer, int offset, int count) |
| Reads a specified number of bytes from the current stream into a byte array 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 WaveMixerStream32 and optionally releases the managed resources.
|
|
|
int | InputCount [get] |
| The number of inputs to this mixer.
|
|
bool | AutoStop [get, set] |
| Automatically stop when all inputs have been read.
|
|
override int | BlockAlign [get] |
| WaveStream.BlockAlign
|
|
override long | Length [get] |
| Length of this Wave Stream (in bytes) System.IO.Stream.Length
|
|
override long | Position [get, set] |
| Position within this Wave Stream (in bytes) System.IO.Stream.Position
|
|
override WaveFormat | WaveFormat [get] |
| WaveStream.WaveFormat
|
|
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)
|
|
|
static unsafe void | Sum32BitAudio (byte[] destBuffer, int offset, byte[] sourceBuffer, int bytesRead) |
| Sums 32-bit audio samples from the source buffer to the destination buffer.
|
|
WaveStream that can mix together multiple 32 bit input streams (Normally used with stereo input channels) All channels must have the same number of inputs.
◆ WaveMixerStream32() [1/2]
NAudio.Wave.WaveMixerStream32.WaveMixerStream32 |
( |
| ) |
|
|
inline |
Creates a new 32 bit WaveMixerStream.
◆ WaveMixerStream32() [2/2]
NAudio.Wave.WaveMixerStream32.WaveMixerStream32 |
( |
IEnumerable< WaveStream > | inputStreams, |
|
|
bool | autoStop ) |
|
inline |
Creates a new 32 bit WaveMixerStream.
- Parameters
-
inputStreams | An Array of WaveStreams - must all have the same format. Use WaveChannel is designed for this purpose. |
autoStop | Automatically stop when all inputs have been read |
- Exceptions
-
ArgumentException | Thrown if the input streams are not 32 bit floating point, or if they have different formats to each other |
◆ AddInputStream()
void NAudio.Wave.WaveMixerStream32.AddInputStream |
( |
WaveStream | waveStream | ) |
|
|
inline |
Adds an input audio stream to the mixer.
- Parameters
-
waveStream | The WaveStream to be added to the mixer. |
- Exceptions
-
ArgumentException | Thrown when the input WaveStream does not meet the required format specifications. |
This method adds the input audio stream waveStream to the mixer. It performs format checks to ensure that the input stream meets the required specifications, such as being in IEEE floating point format and having 32-bit audio. If this is the first input stream being added, it sets the format for the mixer based on the input stream's properties. Subsequent input streams are checked to ensure that they match the format of the existing streams. The input stream is then added to the mixer, and its length is compared with the current length of the mixer, updating it if necessary. Finally, the position of the input stream is set to match the current position of the mixer.
◆ Dispose()
override void NAudio.Wave.WaveMixerStream32.Dispose |
( |
bool | disposing | ) |
|
|
inlineprotected |
Releases the unmanaged resources used by the WaveMixerStream32 and optionally releases the managed resources.
- Parameters
-
disposing | True to release both managed and unmanaged resources; false to release only unmanaged resources. |
This method disposes the input streams if disposing is true, and asserts if disposing is false.
◆ Read()
override int NAudio.Wave.WaveMixerStream32.Read |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
|
inline |
Reads a specified number of bytes from the current stream into a byte array 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 data is read.
- Exceptions
-
ArgumentException | Thrown when count is not a whole number of samples. |
Implements NAudio.Wave.IWaveProvider.
◆ RemoveInputStream()
void NAudio.Wave.WaveMixerStream32.RemoveInputStream |
( |
WaveStream | waveStream | ) |
|
|
inline |
Removes the specified WaveStream from the list of input streams and recalculates the total length of all input streams.
- Parameters
-
waveStream | The WaveStream to be removed from the list of input streams. |
This method removes the specified waveStream from the list of input streams and recalculates the total length of all input streams. If the specified waveStream is successfully removed, the total length of all input streams is recalculated by finding the maximum length among all remaining input streams. The total length is then updated to the new calculated length.
◆ Sum32BitAudio()
static unsafe void NAudio.Wave.WaveMixerStream32.Sum32BitAudio |
( |
byte[] | destBuffer, |
|
|
int | offset, |
|
|
byte[] | sourceBuffer, |
|
|
int | bytesRead ) |
|
inlinestaticprivate |
Sums 32-bit audio samples from the source buffer to the destination buffer.
- Parameters
-
destBuffer | The destination buffer to which the audio samples will be added. |
offset | The offset within the destination buffer where the addition will start. |
sourceBuffer | The source buffer containing the audio samples to be added. |
bytesRead | The number of bytes read from the source buffer. |
This method sums 32-bit audio samples from the source buffer to the destination buffer. It uses unsafe code to work with pointers for performance reasons. The method calculates the number of samples to be read based on the number of bytes read and performs the addition for each sample.
◆ bytesPerSample
readonly int NAudio.Wave.WaveMixerStream32.bytesPerSample |
|
private |
◆ inputsLock
readonly object NAudio.Wave.WaveMixerStream32.inputsLock |
|
private |
◆ inputStreams
readonly List<WaveStream> NAudio.Wave.WaveMixerStream32.inputStreams |
|
private |
◆ length
long NAudio.Wave.WaveMixerStream32.length |
|
private |
◆ position
long NAudio.Wave.WaveMixerStream32.position |
|
private |
◆ waveFormat
WaveFormat NAudio.Wave.WaveMixerStream32.waveFormat |
|
private |
◆ AutoStop
bool NAudio.Wave.WaveMixerStream32.AutoStop |
|
getset |
Automatically stop when all inputs have been read.
◆ BlockAlign
override int NAudio.Wave.WaveMixerStream32.BlockAlign |
|
get |
◆ InputCount
int NAudio.Wave.WaveMixerStream32.InputCount |
|
get |
The number of inputs to this mixer.
◆ Length
override long NAudio.Wave.WaveMixerStream32.Length |
|
get |
Length of this Wave Stream (in bytes) System.IO.Stream.Length
◆ Position
override long NAudio.Wave.WaveMixerStream32.Position |
|
getset |
Position within this Wave Stream (in bytes) System.IO.Stream.Position
◆ WaveFormat
override WaveFormat NAudio.Wave.WaveMixerStream32.WaveFormat |
|
get |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Core/Wave/WaveStreams/WaveMixerStream32.cs