Skip to content

FormatBuilder

AutumnSky1010 edited this page Jun 15, 2024 · 2 revisions

Class FormatBuilder

Definition

Namespace: SoundMaker
Assembly: SoundMaker.dll

Represents a class used to build SoundFormat and FormatChunk.

public class FormatBuilder

Version

2.2.0 ~

Examples

var builder = FormatBuilder.Create()
    .WithFrequency(48000) // Or 44100. Otherwise, an ArgumentException is thrown.
    .WithBitDepth(16)     // Or 16. Otherwise, an ArgumentException is thrown.
    .WithChannelCount(2); // Or 1. Otherwise, an ArgumentException is thrown.

var waveFileFormat = builder.ToFormatChunk();
var soundFormat = builder.ToSoundFormat();

Inheritance

Object -> FormatBuilder

Methods

Create()

Declaration

public static SamplingFrequencyBuilder Create()

Returns

Type Desctiption
The builder Returns SamplingFrequencyBuilder, BitDepthBuilder, ChannelTypeBuilder, in that order. See examples for usage.

ToFormatChunk()

Declaration

public FormatChunk ToFormatChunk()

Returns

Type Desctiption
FormatChunk The FormatChunk object.

ToSoundFormat()

Declaration

public SoundFormat ToSoundFormat()

Returns

Type Desctiption
SoundFormat The SoundFormat object.
Clone this wiki locally