Table of Contents

Interface ISfzSampleLoader

Namespace
NAudio.Sampler
Assembly
NAudio.Sampler.dll

Loads an SFZ region's sample file into a mono float buffer. Pluggable so the format coverage can grow (WAV today; FLAC/Ogg via NAudio.SoundFile later) and so tests can supply synthetic samples.

public interface ISfzSampleLoader

Methods

TryLoad(string, out float[], out float[], out int, out SampleLoop?)

Loads the sample at path (as written in the SFZ) into channel buffers: left is the left/mono channel and right is the right channel, or null for a mono sample. embeddedLoop carries loop points authored in the sample file itself (a WAV smpl chunk), or null if there are none — per the SFZ spec these are the region's default loop points and make loop_mode default to loop_continuous. Returns false if the sample cannot be found or decoded.

bool TryLoad(string path, out float[] left, out float[] right, out int sampleRate, out SampleLoop? embeddedLoop)

Parameters

path string
left float[]
right float[]
sampleRate int
embeddedLoop SampleLoop?

Returns

bool