@diffusionstudio/core-v4
Version:
2D motion graphics and video rendering engine
27 lines (26 loc) • 875 B
TypeScript
import { AudioSource } from '../../sources';
type AudioDecoderOptions = {
volume: number;
start: number;
stop: number;
};
/**
* Handles audio decoding and playback from various sources.
* Supports both direct WebAudio API decoding and AudioBufferSink sources.
*/
export declare class AudioDecoder {
private readonly source;
private readonly options;
private context?;
private gainNode?;
private iterator?;
constructor(source: AudioSource, options: AudioDecoderOptions);
/**
* Initializes the audio decoder with the given audio context.
* Sets up audio nodes and prepares the audio generator.
*/
init(context: AudioContext | OfflineAudioContext, audioDestination: AudioNode): Promise<this>;
/** Play audio up until playbackTime. */
forward(playbackTime: number, delay: number): Promise<void>;
}
export {};