WaveBuffer class use to store wave datas. Data can be manipulated with arrays (ByteBuffer,FloatBuffer,ShortBuffer,IntBuffer ) that are pointing to the same memory buffer. Use the associated Count property based on the type of buffer to get the number of data in the buffer. Implicit casting is now supported to float[], byte[], int[], short[]. You must not use Length on returned arrays.
More...
|
| WaveBuffer (int sizeToAllocateInBytes) |
| Initializes a new instance of the WaveBuffer class.
|
|
| WaveBuffer (byte[] bufferToBoundTo) |
| Initializes a new instance of the WaveBuffer class binded to a specific byte buffer.
|
|
void | BindTo (byte[] bufferToBoundTo) |
| Binds the provided byte array to the WaveBuffer instance.
|
|
void | Clear () |
| Clears the byte buffer by setting all elements to zero.
|
|
void | Copy (Array destinationArray) |
| Copies the elements of the current one-dimensional array to another one-dimensional array.
|
|
|
int | CheckValidityCount (string argName, int value, int sizeOfValue) |
| Checks the validity of the count and returns the new number of bytes.
|
|
WaveBuffer class use to store wave datas. Data can be manipulated with arrays (ByteBuffer,FloatBuffer,ShortBuffer,IntBuffer ) that are pointing to the same memory buffer. Use the associated Count property based on the type of buffer to get the number of data in the buffer. Implicit casting is now supported to float[], byte[], int[], short[]. You must not use Length on returned arrays.
n.b. FieldOffset is 8 now to allow it to work natively on 64 bit
◆ WaveBuffer() [1/2]
NAudio.Wave.WaveBuffer.WaveBuffer |
( |
int | sizeToAllocateInBytes | ) |
|
|
inline |
Initializes a new instance of the WaveBuffer class.
- Parameters
-
sizeToAllocateInBytes | The number of bytes. The size of the final buffer will be aligned on 4 Bytes (upper bound) |
◆ WaveBuffer() [2/2]
NAudio.Wave.WaveBuffer.WaveBuffer |
( |
byte[] | bufferToBoundTo | ) |
|
|
inline |
Initializes a new instance of the WaveBuffer class binded to a specific byte buffer.
- Parameters
-
bufferToBoundTo | A byte buffer to bound the WaveBuffer to. |
◆ BindTo()
void NAudio.Wave.WaveBuffer.BindTo |
( |
byte[] | bufferToBoundTo | ) |
|
|
inline |
Binds the provided byte array to the WaveBuffer instance.
- Parameters
-
bufferToBoundTo | The byte array to be bound to the WaveBuffer. |
This method binds the provided byte array bufferToBoundTo to the WaveBuffer instance. If the length of the byte array is not a multiple of 4, an ArgumentException is thrown.
◆ CheckValidityCount()
int NAudio.Wave.WaveBuffer.CheckValidityCount |
( |
string | argName, |
|
|
int | value, |
|
|
int | sizeOfValue ) |
|
inlineprivate |
Checks the validity of the count and returns the new number of bytes.
- Parameters
-
argName | The name of the argument being checked. |
value | The value to be checked. |
sizeOfValue | The size of the value. |
- Exceptions
-
ArgumentOutOfRangeException | Thrown when the count is not 4 bytes aligned or exceeds the maximum count. |
- Returns
- The new number of bytes calculated based on the input value and sizeOfValue .
This method calculates the new number of bytes based on the input value and sizeOfValue . It checks if the new number of bytes is 4 bytes aligned and within the valid range, throwing an exception if not.
◆ Clear()
void NAudio.Wave.WaveBuffer.Clear |
( |
| ) |
|
|
inline |
Clears the byte buffer by setting all elements to zero.
This method clears the byte buffer by setting all elements to zero using the Array.Clear method.
◆ Copy()
void NAudio.Wave.WaveBuffer.Copy |
( |
Array | destinationArray | ) |
|
|
inline |
Copies the elements of the current one-dimensional array to another one-dimensional array.
- Parameters
-
destinationArray | The one-dimensional array that is the destination of the elements copied from the current array. |
- Exceptions
-
ArgumentNullException | Thrown when the destinationArray is null. |
RankException | Thrown when the number of dimensions in the source Array is not equal to the number of dimensions in the destination array. |
◆ operator byte[]()
static implicit NAudio.Wave.WaveBuffer.operator byte[] |
( |
WaveBuffer | waveBuffer | ) |
|
|
inlinestatic |
Performs an implicit conversion from NAudio.Wave.WaveBuffer to System.Byte.
- Parameters
-
waveBuffer | The wave buffer. |
- Returns
- The result of the conversion.
◆ operator float[]()
static implicit NAudio.Wave.WaveBuffer.operator float[] |
( |
WaveBuffer | waveBuffer | ) |
|
|
inlinestatic |
Performs an implicit conversion from NAudio.Wave.WaveBuffer to System.Single.
- Parameters
-
waveBuffer | The wave buffer. |
- Returns
- The result of the conversion.
◆ operator int[]()
static implicit NAudio.Wave.WaveBuffer.operator int[] |
( |
WaveBuffer | waveBuffer | ) |
|
|
inlinestatic |
Performs an implicit conversion from NAudio.Wave.WaveBuffer to System.Int32.
- Parameters
-
waveBuffer | The wave buffer. |
- Returns
- The result of the conversion.
◆ operator short[]()
static implicit NAudio.Wave.WaveBuffer.operator short[] |
( |
WaveBuffer | waveBuffer | ) |
|
|
inlinestatic |
Performs an implicit conversion from NAudio.Wave.WaveBuffer to System.Int16.
- Parameters
-
waveBuffer | The wave buffer. |
- Returns
- The result of the conversion.
◆ byteBuffer
byte [] NAudio.Wave.WaveBuffer.byteBuffer |
|
private |
◆ floatBuffer
float [] NAudio.Wave.WaveBuffer.floatBuffer |
|
private |
◆ intBuffer
int [] NAudio.Wave.WaveBuffer.intBuffer |
|
private |
◆ numberOfBytes
int NAudio.Wave.WaveBuffer.numberOfBytes |
◆ shortBuffer
short [] NAudio.Wave.WaveBuffer.shortBuffer |
|
private |
◆ ByteBuffer
byte [] NAudio.Wave.WaveBuffer.ByteBuffer |
|
get |
◆ ByteBufferCount
int NAudio.Wave.WaveBuffer.ByteBufferCount |
|
getset |
◆ FloatBuffer
float [] NAudio.Wave.WaveBuffer.FloatBuffer |
|
get |
◆ FloatBufferCount
int NAudio.Wave.WaveBuffer.FloatBufferCount |
|
getset |
◆ IntBuffer
int [] NAudio.Wave.WaveBuffer.IntBuffer |
|
get |
◆ IntBufferCount
int NAudio.Wave.WaveBuffer.IntBufferCount |
|
getset |
◆ MaxSize
int NAudio.Wave.WaveBuffer.MaxSize |
|
get |
Gets the max size in bytes of the byte buffer..
Maximum number of bytes in the buffer.
Implements NAudio.Wave.IWaveBuffer.
◆ ShortBuffer
short [] NAudio.Wave.WaveBuffer.ShortBuffer |
|
get |
◆ ShortBufferCount
int NAudio.Wave.WaveBuffer.ShortBufferCount |
|
getset |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Core/Wave/WaveOutputs/WaveBuffer.cs