Represents Channel for the WaveMixerStream 32 bit output and 16 bit input It's output is always stereo The input stream can be panned.
More...
|
| WaveChannel32 (WaveStream sourceStream, float volume, float pan) |
| Creates a new WaveChannel32.
|
|
| WaveChannel32 (WaveStream sourceStream) |
| Creates a WaveChannel32 with default settings.
|
|
override int | Read (byte[] destBuffer, int offset, int numBytes) |
| Reads audio data from the source stream and writes it to the destination buffer.
|
|
override bool | HasData (int count) |
| Checks if the source stream has data available based on the specified count.
|
|
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.
|
|
|
override void | Dispose (bool disposing) |
| Releases the unmanaged resources used by the WaveChannel32 and optionally releases the managed resources.
|
|
|
override int | BlockAlign [get] |
| Gets the block alignment for this WaveStream.
|
|
override long | Length [get] |
| Returns the stream length.
|
|
override long | Position [get, set] |
| Gets or sets the current position in the stream.
|
|
bool | PadWithZeroes [get, set] |
| If true, Read always returns the number of bytes requested.
|
|
override WaveFormat | WaveFormat [get] |
| WaveStream.WaveFormat
|
|
float | Volume [get, set] |
| Volume of this channel. 1.0 = full scale.
|
|
float | Pan [get, set] |
| Pan of this channel (from -1 to 1)
|
|
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 | SourceToDest (long sourceBytes) |
| Converts the size of the source bytes to the size of the destination bytes based on the sample sizes and returns the result.
|
|
long | DestToSource (long destBytes) |
| Converts the destination bytes to source bytes based on the sample sizes and returns the result.
|
|
void | RaiseSample (float left, float right) |
| Raises the Sample event with the specified left and right values.
|
|
Represents Channel for the WaveMixerStream 32 bit output and 16 bit input It's output is always stereo The input stream can be panned.
◆ WaveChannel32() [1/2]
NAudio.Wave.WaveChannel32.WaveChannel32 |
( |
WaveStream | sourceStream, |
|
|
float | volume, |
|
|
float | pan ) |
|
inline |
Creates a new WaveChannel32.
- Parameters
-
sourceStream | the source stream |
volume | stream volume (1 is 0dB) |
pan | pan control (-1 to 1) |
◆ WaveChannel32() [2/2]
NAudio.Wave.WaveChannel32.WaveChannel32 |
( |
WaveStream | sourceStream | ) |
|
|
inline |
Creates a WaveChannel32 with default settings.
- Parameters
-
sourceStream | The source stream |
◆ DestToSource()
long NAudio.Wave.WaveChannel32.DestToSource |
( |
long | destBytes | ) |
|
|
inlineprivate |
Converts the destination bytes to source bytes based on the sample sizes and returns the result.
- Parameters
-
destBytes | The number of destination bytes to be converted. |
- Returns
- The equivalent number of source bytes calculated based on the sample sizes.
◆ Dispose()
override void NAudio.Wave.WaveChannel32.Dispose |
( |
bool | disposing | ) |
|
|
inlineprotected |
Releases the unmanaged resources used by the WaveChannel32 and optionally releases the managed resources.
- Parameters
-
disposing | True to release both managed and unmanaged resources; false to release only unmanaged resources. |
This method releases the unmanaged resources used by the WaveChannel32 and optionally releases the managed resources. If disposing is true, this method disposes of the sourceStream if it is not null. If disposing is false, this method asserts that the WaveChannel32 was not disposed.
◆ HasData()
override bool NAudio.Wave.WaveChannel32.HasData |
( |
int | count | ) |
|
|
inlinevirtual |
Checks if the source stream has data available based on the specified count.
- Parameters
-
count | The number of bytes to check for availability. |
- Returns
- True if the source stream has data available for the specified count; otherwise, false.
This method checks whether the source stream has data available based on the specified count. It first checks if the source stream has data, and then verifies if the position plus count is not less than 0. If both conditions are met, it returns true if the position is less than the length and the volume is not equal to 0; otherwise, it returns false.
Reimplemented from NAudio.Wave.WaveStream.
◆ RaiseSample()
void NAudio.Wave.WaveChannel32.RaiseSample |
( |
float | left, |
|
|
float | right ) |
|
inlineprivate |
Raises the Sample event with the specified left and right values.
- Parameters
-
left | The left value to be raised. |
right | The right value to be raised. |
This method raises the Sample event with the specified left and right values by updating the SampleEventArgs instance and invoking the event.
◆ Read()
override int NAudio.Wave.WaveChannel32.Read |
( |
byte[] | destBuffer, |
|
|
int | offset, |
|
|
int | numBytes ) |
|
inline |
Reads audio data from the source stream and writes it to the destination buffer.
- Parameters
-
destBuffer | The destination buffer to write the audio data to. |
offset | The offset in the destination buffer at which to start writing the audio data. |
numBytes | The number of bytes of audio data to read and write to the destination buffer. |
- Returns
- The number of bytes written to the destination buffer.
This method reads audio data from the source stream and writes it to the destination buffer. It first fills with silence if the position is less than 0, then loads the next chunk of audio data from the source stream and writes it to the destination buffer. It implements panning laws and adjusts the volume of the audio data. If PadWithZeroes is true, it fills out the remaining space in the destination buffer with zeroes. The position is updated by the number of bytes written to the destination buffer.
Implements NAudio.Wave.IWaveProvider.
◆ SourceToDest()
long NAudio.Wave.WaveChannel32.SourceToDest |
( |
long | sourceBytes | ) |
|
|
inlineprivate |
Converts the size of the source bytes to the size of the destination bytes based on the sample sizes and returns the result.
- Parameters
-
sourceBytes | The size of the source bytes to be converted. |
- Returns
- The size of the destination bytes calculated based on the sample sizes.
◆ destBytesPerSample
readonly int NAudio.Wave.WaveChannel32.destBytesPerSample |
|
private |
◆ length
readonly long NAudio.Wave.WaveChannel32.length |
|
private |
◆ lockObject
readonly object NAudio.Wave.WaveChannel32.lockObject = new object() |
|
private |
◆ pan
volatile float NAudio.Wave.WaveChannel32.pan |
|
private |
◆ position
long NAudio.Wave.WaveChannel32.position |
|
private |
◆ sampleEventArgs
◆ sampleProvider
◆ sourceBytesPerSample
readonly int NAudio.Wave.WaveChannel32.sourceBytesPerSample |
|
private |
◆ sourceStream
◆ volume
volatile float NAudio.Wave.WaveChannel32.volume |
|
private |
◆ waveFormat
readonly WaveFormat NAudio.Wave.WaveChannel32.waveFormat |
|
private |
◆ BlockAlign
override int NAudio.Wave.WaveChannel32.BlockAlign |
|
get |
Gets the block alignment for this WaveStream.
◆ Length
override long NAudio.Wave.WaveChannel32.Length |
|
get |
Returns the stream length.
◆ PadWithZeroes
bool NAudio.Wave.WaveChannel32.PadWithZeroes |
|
getset |
If true, Read always returns the number of bytes requested.
◆ Pan
float NAudio.Wave.WaveChannel32.Pan |
|
getset |
Pan of this channel (from -1 to 1)
◆ Position
override long NAudio.Wave.WaveChannel32.Position |
|
getset |
Gets or sets the current position in the stream.
◆ Volume
float NAudio.Wave.WaveChannel32.Volume |
|
getset |
Volume of this channel. 1.0 = full scale.
◆ WaveFormat
override WaveFormat NAudio.Wave.WaveChannel32.WaveFormat |
|
get |
◆ Sample
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/WaveChannel32.cs