UNPKG

soundfont2

Version:

A SoundFont2 parser for Node.js and web browsers

37 lines (36 loc) 1.31 kB
import { RIFFChunk } from './riffChunk'; /** * Attempts to parse a RIFF file from a raw buffer. * * @param {Uint8Array} buffer - The input buffer */ export declare const parseBuffer: (buffer: Uint8Array) => RIFFChunk; /** * Get a RIFF chunk from a buffer. * * @param {Buffer} buffer - The input buffer * @param {number} start - Where to start reading the buffer */ export declare const getChunk: (buffer: Uint8Array, start: number) => RIFFChunk; /** * Get the length of a chunk, based on the RIFF length specifier. * * @param {Buffer} buffer - The input buffer * @param {number} start - Where to start reading the buffer for the length */ export declare const getChunkLength: (buffer: Uint8Array, start: number) => number; /** * Get all sub-chunks in a buffer. This will read until the end of the buffer and return any * sub-chunks found in it. * * @param {Buffer} buffer - The input buffer */ export declare const getSubChunks: (buffer: Uint8Array) => RIFFChunk[]; /** * Get the chunk ID (fourCC) from the buffer. This assumes the fourCC code is formatted as an UTF-8 * string. * * @param {Buffer} buffer - The input buffer * @param {number} start - Where to start reading the chunk ID from the buffer */ export declare const getChunkId: (buffer: Uint8Array, start?: number) => string;