Table of Contents

Class SoundFileWriterOptions

Namespace
NAudio.SoundFile
Assembly
NAudio.SoundFile.dll

Optional configuration for a SoundFileWriter.

public class SoundFileWriterOptions
Inheritance
SoundFileWriterOptions
Inherited Members

Remarks

Compression quality is deliberately not part of the format value: libsndfile sets it after the file is opened via sf_command, so it lives here rather than on SoundFileSubtype.

Properties

Clipping

Clip out-of-range samples when converting float input to an integer subtype (e.g. PCM 16/24). true by default — without it, libsndfile wraps a sample above 1.0 into loud distortion. Turn off only if you have a specific reason.

public bool Clipping { get; set; }

Property Value

bool

CompressionLevel

Compression level for FLAC, from 0.0 (fastest) to 1.0 (smallest). When null the codec default is used. Applied via SFC_SET_COMPRESSION_LEVEL after the file is opened.

public double? CompressionLevel { get; set; }

Property Value

double?

Subtype

The sample encoding stored in the file. Default (the default) lets the writer pick the natural subtype for the major format.

public SoundFileSubtype Subtype { get; set; }

Property Value

SoundFileSubtype

Tags

Metadata (title/artist/album/…) to embed. Written before the first audio frame. Codec support varies (Vorbis comments for FLAC/Ogg/Opus, a limited LIST/INFO set for WAV/AIFF); unsupported fields are silently ignored. null writes no tags.

public SoundFileTags Tags { get; set; }

Property Value

SoundFileTags

VbrQuality

VBR encoding quality for Vorbis/Opus, from 0.0 (smallest) to 1.0 (best). When null the codec default is used. Applied via SFC_SET_VBR_ENCODING_QUALITY after the file is opened.

public double? VbrQuality { get; set; }

Property Value

double?