mwg API
    Preparing search index...

    Type Alias SoundFontSampleDecoder

    SoundFontSampleDecoder: (
        bytes: Uint8Array,
        rate: number,
        codec: SampleCodec,
    ) => Int16Array | Promise<Int16Array>

    Turns the compressed bytes of one SoundFont 3 sample (Ogg Vorbis, Ogg Opus or FLAC, named by codec) into mono 16-bit frames at the sample's own rate, which is the rate its header states and the frame count its loop points were written against. Synchronous or asynchronous: a browser decodes through WebAudio (webAudioSampleDecoder), a Node tool through whatever it has installed (decodeFlac needs nothing). A decoder written for Vorbis alone may ignore codec.

    Type Declaration

      • (
            bytes: Uint8Array,
            rate: number,
            codec: SampleCodec,
        ): Int16Array | Promise<Int16Array>
      • Parameters

        Returns Int16Array | Promise<Int16Array>