import { BaseClip } from './base-clip'; import { IClip, IPlaybackCapable } from './iclip'; import { AudioJSON } from '../json-serialization'; interface IAudioOpts { loop?: boolean; volume?: number; } /** * Audio clip providing audio data for creating and editing audio/video * * @example * // Load audio clip asynchronously * const audioClip = await Audio.fromUrl('path/to/audio.mp3', { * loop: true, * }); * * @example * // Traditional approach (for advanced use) * new Audio((await fetch('')).body, { * loop: true, * }), */ export declare class Audio extends BaseClip implements IPlaybackCapable { readonly type = "Audio"; static ctx: AudioContext | null; ready: IClip['ready']; private _meta; /** * Audio metadata * * ⚠️ Note, these are converted (normalized) metadata, not original audio metadata */ get meta(): { sampleRate: number; chanCount: number; duration: number; width: number; height: number; }; private chan0Buf; private chan1Buf; /** * Get complete PCM data from audio clip */ getPCMData(): Float32Array[]; private opts; /** * Whether to loop the audio (hybrid JSON structure) */ loop: boolean; /** * Load an audio clip from a URL * @param url Audio URL * @param opts Audio configuration (loop, volume) * @returns Promise that resolves to an audio clip * * @example * const audioClip = await Audio.fromUrl('path/to/audio.mp3', { * loop: true, * volume: 0.8, * }); */ static fromUrl(url: string, opts?: IAudioOpts): Promise