Table of Contents

Class RiffWriter

Namespace
Bonsai.Audio
Assembly
Bonsai.Audio.dll

Writes audio data into a stream following the RIFF/WAV format.

public sealed class RiffWriter : IDisposable
Inheritance
RiffWriter
Implements
Inherited Members

Constructors

RiffWriter(Stream, int, int, int)

Initializes a new instance of the RiffWriter class using the specified stream, number of channels, sample rate and bits per sample.

public RiffWriter(Stream stream, int channels, int samplesPerSecond, int bitsPerSample)

Parameters

stream Stream

The output stream.

channels int

The number of audio channels.

samplesPerSecond int

The playback sample frequency, in samples per second.

bitsPerSample int

The number of bits per audio sample.

Methods

Close()

Closes the current RiffWriter and the underlying stream.

public void Close()

Write(byte[])

Writes an array containing raw audio data into the WAV stream.

public void Write(byte[] buffer)

Parameters

buffer byte[]

A byte array containing the data to write.