spessasynth_core documentation
    Preparing search index...

    Class EmptySample

    A simplified class for creating BasicSample.

    Hierarchy (View Summary)

    Index
    audioData?: Float32Array<ArrayBufferLike>

    The sample's audio data.

    compressedData?: Uint8Array<ArrayBufferLike>

    The compressed sample data if the sample has been compressed.

    dataOverridden: boolean = true

    Indicates if the data was overridden, so it cannot be copied back unchanged.

    linkedSample?: BasicSample

    The other linked sample of the stereo pair. undefined if the sample has no link.

    linkedTo: BasicInstrument[] = []

    Sample's linked instruments (the instruments that use it).

    loopEnd: number

    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.

    loopStart: number

    The sample's loop start index, inclusive. In sample data points, relative to the start of the sample.

    Minimum allowed value is 0.

    name: string

    The sample's name.

    originalKey: number

    The MIDI note number of the recorded pitch for this sample.

    pitchCorrection: number

    The pitch correction to apply in cents. It can be negative.

    sampleRate: number

    The sample rate of the sample, in Hertz.

    sampleType: SampleType

    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.

    • Get raw data for writing the file, either a compressed bit stream or signed 16-bit little endian PCM data.

      Parameters

      • allowVorbis: boolean

        if vorbis file data is allowed.

      Returns Uint8Array

      either s16le or vorbis data.