UNPKG

@diffusionstudio/core-v4

Version:

2D motion graphics and video rendering engine

58 lines (57 loc) 2.46 kB
import { MediaInput } from '../types'; declare const WebAudioDecoder_base: { new (...args: any[]): { _handlers: { '*'?: { [x: string]: (event: import('../mixins/event/types').EmittedEvent<any, any>) => void; } | undefined; error?: { [x: string]: (event: import('../mixins/event/types').EmittedEvent<Error, any>) => void; } | undefined; }; on<T extends "*" | "error">(eventType: T, callback: (event: import('../mixins/event/types').EmittedEvent<{ '*': any; error: Error; }[T], /*elided*/ any>) => void): string; off(id?: string | "*", ...ids: string[]): void; emit<T extends "*" | "error">(eventType: T, detail: { '*': any; error: Error; }[T]): void; bubble(target: { _handlers: { '*'?: { [x: string]: (event: import('../mixins/event/types').EmittedEvent<any, any>) => void; } | undefined; error?: { [x: string]: (event: import('../mixins/event/types').EmittedEvent<Error, any>) => void; } | undefined; }; on<T extends "*" | "error">(eventType: T, callback: (event: import('../mixins/event/types').EmittedEvent<{ '*': any; error: Error; }[T], /*elided*/ any>) => void): string; off(id?: string | "*", ...ids: string[]): void; emit<T extends "*" | "error">(eventType: T, detail: { '*': any; error: Error; }[T]): void; bubble(target: /*elided*/ any): string; resolve(eventType: "*" | "error"): (resolve: (value: unknown) => void, reject: (reason?: any) => void) => void; }): string; resolve(eventType: "*" | "error"): (resolve: (value: unknown) => void, reject: (reason?: any) => void) => void; }; }; export declare class WebAudioDecoder extends WebAudioDecoder_base { private input; private buffers; constructor(input: MediaInput); /** * Decodes an audio file or URL and returns a resampled AudioBuffer. * @param input - Either a File, Blob, or URL string. * @returns Promise<AudioBuffer> */ decode(numberOfChannels?: number, sampleRate?: number, cache?: boolean): Promise<AudioBuffer>; dispose(): Promise<void>; } export {};