ts-audio
Version:
`ts-audio` is an agnostic and easy-to-use library to work with the `AudioContext` API and create Playlists.
14 lines (13 loc) • 516 B
TypeScript
/**
* Fetches an audio file and returns it as an ArrayBuffer.
*/
export declare const getBuffer: (file: string) => Promise<ArrayBuffer>;
/**
* Throws a formatted error with the ts-audio prefix.
*/
export declare const throwsError: (value: string) => void;
/**
* Attempts to preload an audio file with automatic retry mechanism.
* Will recursively retry loading the file up to the specified number of attempts.
*/
export declare const preloadFile: (file: string, attempts?: number, done?: () => void) => void;