Xeno-rat
|
A wave file writer that adds cue support. More...
Public Member Functions | |
CueWaveFileWriter (string fileName, WaveFormat waveFormat) | |
Writes a wave file, including a cues chunk. | |
void | AddCue (int position, string label) |
Adds a cue at the specified position with the given label. | |
![]() | |
WaveFileWriter (Stream outStream, WaveFormat format) | |
WaveFileWriter that actually writes to a stream. | |
WaveFileWriter (string filename, WaveFormat format) | |
Creates a new WaveFileWriter. | |
override int | Read (byte[] buffer, int offset, int count) |
Throws an InvalidOperationException with the message "Cannot read from a WaveFileWriter". | |
override long | Seek (long offset, SeekOrigin origin) |
Throws an InvalidOperationException with the message "Cannot seek within a WaveFileWriter". | |
override void | SetLength (long value) |
Throws an InvalidOperationException with the message "Cannot set length of a WaveFileWriter". | |
void | WriteData (byte[] data, int offset, int count) |
Writes the specified number of samples from the given array, starting at the specified offset. | |
override void | Write (byte[] data, int offset, int count) |
Writes the specified bytes to the WAV file. | |
void | WriteSample (float sample) |
Writes the specified audio sample to the wave file. | |
void | WriteSamples (float[] samples, int offset, int count) |
Writes audio samples to the output stream based on the specified format and data. | |
void | WriteData (short[] samples, int offset, int count) |
Writes 16 bit samples to the Wave file. | |
void | WriteSamples (short[] samples, int offset, int count) |
Writes 16 bit samples to the Wave file. | |
override void | Flush () |
Updates the header and flushes the underlying stream. | |
Protected Member Functions | |
override void | UpdateHeader (BinaryWriter writer) |
Updates the header and writes cues using the provided BinaryWriter. | |
![]() | |
override void | Dispose (bool disposing) |
Releases the unmanaged resources used by the ClassName and optionally releases the managed resources. | |
Private Member Functions | |
void | WriteCues (BinaryWriter w) |
Writes the cue chunks to the end of the stream. | |
Private Attributes | |
CueList | cues = null |
Additional Inherited Members | |
![]() | |
static void | CreateWaveFile16 (string filename, ISampleProvider sourceProvider) |
Creates a 16-bit wave file from the provided sourceProvider and saves it with the specified filename . | |
static void | CreateWaveFile (string filename, IWaveProvider sourceProvider) |
Creates a wave file with the specified filename using the provided wave provider. | |
static void | WriteWavFileToStream (Stream outStream, IWaveProvider sourceProvider) |
Writes the audio data from the specified sourceProvider to the outStream in WAV format. | |
![]() | |
string | Filename [get] |
The wave file name or null if not applicable. | |
override long | Length [get] |
Number of bytes of audio in the data chunk. | |
TimeSpan | TotalTime [get] |
Total time (calculated from Length and average bytes per second) | |
WaveFormat | WaveFormat [get] |
WaveFormat of this wave file. | |
override bool | CanRead [get] |
Returns false: Cannot read from a WaveFileWriter. | |
override bool | CanWrite [get] |
Returns true: Can write to a WaveFileWriter. | |
override bool | CanSeek [get] |
Returns false: Cannot seek within a WaveFileWriter. | |
override long | Position [get, set] |
Gets the Position in the WaveFile (i.e. number of bytes written so far) | |
A wave file writer that adds cue support.
|
inline |
Writes a wave file, including a cues chunk.
|
inline |
Adds a cue at the specified position with the given label.
position | The position at which the cue should be added. |
label | The label for the cue. |
If the cues list is null, a new CueList is created. The method then adds a new cue with the specified position and label to the cues list.
|
inlineprotectedvirtual |
Updates the header and writes cues using the provided BinaryWriter.
writer | The BinaryWriter used to write the cues. |
This method updates the header by calling the base class's UpdateHeader method and then writes cues using the provided BinaryWriter.
Reimplemented from NAudio.Wave.WaveFileWriter.
|
inlineprivate |
Writes the cue chunks to the end of the stream.
w | The BinaryWriter used to write the cue chunks. |
This method writes the cue chunks to the end of the stream. If the cues are not null, it gets the RIFF chunks and their size, then writes them to the end of the stream using the BinaryWriter. It also ensures that the stream is aligned by checking if the length is odd and adding a byte if necessary. After writing the cue chunks, it updates the size information at the beginning of the stream.
|
private |