Interface ISampleSource
- Namespace
- Sigil.Sound
- Assembly
- Sigil.Sound.dll
Where a host keeps the sample files its scripts can use: a folder, a browser's storage, an asset database. Scripts never see this; they go through Sigil.Sound.SampleLibrary, which only passes on names this source lists.
public interface ISampleSourceRemarks
Implement it to give a host its own library. Names are paths relative to the library with forward slashes
(kick.wav, drums/snare.wav); they are what scripts type and what completion offers.
Properties
Names
The names of every sample that can be loaded, sorted for display. Called while an editor offers completions, so keep it cheap (cache the listing and refresh it when the library changes).
IReadOnlyList<string> Names { get; }Property Value
Methods
Load(string)
Decodes one sample. name is always one of Sigil.Sound.ISampleSource.Names.
AudioBuffer Load(string name)Parameters
namestring-
A name exactly as listed in Sigil.Sound.ISampleSource.Names.
Returns
- AudioBuffer
-
The decoded audio. It is shared and read-only, so the same buffer may be returned for repeated loads.