Protected OptionalaudioThe sample's audio data.
Protected OptionalcompressedThe compressed sample data if the sample has been compressed.
ProtecteddataIndicates if the data was overridden, so it cannot be copied back unchanged.
OptionallinkedThe other linked sample of the stereo pair. undefined if the sample has no link.
Sample's linked instruments (the instruments that use it).
The sample's loop end index, exclusive. In sample data points, relative to the start of the sample.
Maximum allowed value is the sample data length.
The sample's loop start index, inclusive. In sample data points, relative to the start of the sample.
Minimum allowed value is 0.
The sample's name.
The MIDI note number of the recorded pitch for this sample.
The pitch correction to apply in cents. It can be negative.
The sample rate of the sample, in Hertz.
The type of the sample, as defined per SF2 specification:
The value in sfSampleType is an enumeration with eight defined values: monoSample = 1, rightSample = 2, leftSample = 4, linkedSample = 8, RomMonoSample = 32769, RomRightSample = 32770, RomLeftSample = 32772, and RomLinkedSample = 32776. It can be seen that this is encoded such that bit 15 of the 16 bit value is set if the sample is in ROM, and reset if it is included in the SoundFont compatible bank. The four LS bits of the word are then exclusively set indicating mono, left, right, or linked.
Indicates if the sample contains compressed audio.
If the sample is linked to another sample.
How many instruments is this sample used by.
ProtecteddecodeDecode binary vorbis into a float32 pcm
ProtectedencodeGet the PCM Float32 audio data of this sample. This either decodes the compressed data or passes the ready sampleData.
The raw audio data.
Get raw data for writing the file, either a compressed bit stream or signed 16-bit little endian PCM data.
if vorbis file data is allowed.
either s16le or vorbis data.
Resamples the audio data in-place to a given sample rate.
The new sample rate, in hertz.
Replaces the audio data in-place.
The new audio data as Float32.
The new sample rate, in Hertz.
Replaces the audio with a compressed data sample and flags the sample as compressed.
The new compressed data.
Links a stereo sample.
The sample to link to.
Either left, right or linked. The linked sample will be set appropriately as well.
Sets the sample type and unlinks if needed.
The type to set it to.
Unlinks the sample from a given instrument
the instrument to unlink from
Unlinks the sample from its stereo link if it has any.
A simplified class for creating BasicSample.