Broadcast WAVE File Writer.
More...
|
| BwfWriter (string filename, WaveFormat format, BextChunkInfo bextChunkInfo) |
| Createa a new BwfWriter.
|
|
void | Write (byte[] buffer, int offset, int count) |
| Writes a specified number of bytes from a byte array to the current stream at the specified position.
|
|
void | Flush () |
| Flushes the underlying writer and ensures the WAV file is always playable after the flush operation.
|
|
void | Dispose () |
| Disposes of the current object and releases any resources it is using.
|
|
|
void | FixUpChunkSizes (bool restorePosition) |
| Fixes up the chunk sizes in the WAV file.
|
|
|
static byte[] | GetAsBytes (string message, int byteSize) |
| Converts the input string to a byte array of the specified size and returns the result.
|
|
Broadcast WAVE File Writer.
◆ BwfWriter()
Createa a new BwfWriter.
- Parameters
-
filename | Rarget filename |
format | WaveFormat |
bextChunkInfo | Chunk information |
◆ Dispose()
void NAudio.Wave.BwfWriter.Dispose |
( |
| ) |
|
|
inline |
Disposes of the current object and releases any resources it is using.
This method checks if the object has already been disposed. If not, it calls the FixUpChunkSizes method with the parameter false
to perform any necessary cleanup. It then disposes of the internal writer and sets the isDisposed
flag to true
.
◆ FixUpChunkSizes()
void NAudio.Wave.BwfWriter.FixUpChunkSizes |
( |
bool | restorePosition | ) |
|
|
inlineprivate |
Fixes up the chunk sizes in the WAV file.
- Parameters
-
restorePosition | A boolean value indicating whether to restore the position of the writer after fixing up the chunk sizes. |
This method adjusts the chunk sizes in the WAV file based on the data length and format. If the data length exceeds Int32.MaxValue, it updates the RIFF and data chunk sizes for RF64 format. Otherwise, it updates the RIFF and data chunk sizes for standard WAV format. The method also handles restoring the position of the writer if specified.
◆ Flush()
void NAudio.Wave.BwfWriter.Flush |
( |
| ) |
|
|
inline |
Flushes the underlying writer and ensures the WAV file is always playable after the flush operation.
- Exceptions
-
ObjectDisposedException | Thrown if the BWF Writer has already been disposed. |
◆ GetAsBytes()
static byte[] NAudio.Wave.BwfWriter.GetAsBytes |
( |
string | message, |
|
|
int | byteSize ) |
|
inlinestaticprivate |
Converts the input string to a byte array of the specified size and returns the result.
- Parameters
-
message | The input string to be converted to a byte array. |
byteSize | The size of the byte array to be generated. |
- Returns
- A byte array representing the input string, with a length of byteSize . If the input string is shorter than byteSize , the remaining bytes are filled with zeros.
This method creates a new byte array of size byteSize and then encodes the input string using ASCII encoding. The encoded bytes are then copied to the output buffer, and if the length of the encoded bytes is less than byteSize , the remaining bytes in the output buffer are filled with zeros.
◆ Write()
void NAudio.Wave.BwfWriter.Write |
( |
byte[] | buffer, |
|
|
int | offset, |
|
|
int | count ) |
|
inline |
Writes a specified number of bytes from a byte array to the current stream at the specified position.
- Parameters
-
buffer | The byte array containing the data to write. |
offset | The zero-based byte offset in buffer at which to begin copying bytes to the current stream. |
count | The number of bytes to be written to the current stream. |
- Exceptions
-
ObjectDisposedException | Thrown if the BWF Writer has already been disposed. |
This method writes the specified number of bytes from the given byte array to the current stream at the specified position. It also updates the data length by adding the count of bytes written to the current stream.
◆ dataChunkSizePosition
readonly long NAudio.Wave.BwfWriter.dataChunkSizePosition |
|
private |
◆ dataLength
long NAudio.Wave.BwfWriter.dataLength |
|
private |
◆ format
◆ isDisposed
bool NAudio.Wave.BwfWriter.isDisposed |
|
private |
◆ writer
readonly BinaryWriter NAudio.Wave.BwfWriter.writer |
|
private |
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/BwfWriter.cs