Xeno-rat
Loading...
Searching...
No Matches
NAudio.Wave.CueWaveFileWriter Class Reference

A wave file writer that adds cue support. More...

Inheritance diagram for NAudio.Wave.CueWaveFileWriter:
Collaboration diagram for NAudio.Wave.CueWaveFileWriter:

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.
 
- Public Member Functions inherited from NAudio.Wave.WaveFileWriter
 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.
 
- Protected Member Functions inherited from NAudio.Wave.WaveFileWriter
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 Public Member Functions inherited from NAudio.Wave.WaveFileWriter
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.
 
- Properties inherited from NAudio.Wave.WaveFileWriter
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)
 

Detailed Description

A wave file writer that adds cue support.

Constructor & Destructor Documentation

◆ CueWaveFileWriter()

NAudio.Wave.CueWaveFileWriter.CueWaveFileWriter ( string fileName,
WaveFormat waveFormat )
inline

Writes a wave file, including a cues chunk.

Member Function Documentation

◆ AddCue()

void NAudio.Wave.CueWaveFileWriter.AddCue ( int position,
string label )
inline

Adds a cue at the specified position with the given label.

Parameters
positionThe position at which the cue should be added.
labelThe 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.

Here is the call graph for this function:

◆ UpdateHeader()

override void NAudio.Wave.CueWaveFileWriter.UpdateHeader ( BinaryWriter writer)
inlineprotectedvirtual

Updates the header and writes cues using the provided BinaryWriter.

Parameters
writerThe 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.

Here is the call graph for this function:

◆ WriteCues()

void NAudio.Wave.CueWaveFileWriter.WriteCues ( BinaryWriter w)
inlineprivate

Writes the cue chunks to the end of the stream.

Parameters
wThe 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.

Here is the caller graph for this function:

Member Data Documentation

◆ cues

CueList NAudio.Wave.CueWaveFileWriter.cues = null
private

The documentation for this class was generated from the following file: