modern-canvas
Version:
A JavaScript WebGL rendering engine. only the ESM.
59 lines (58 loc) • 1.92 kB
TypeScript
import type { HTMLSound } from './html';
import type { IPlayOptions } from './interfaces';
import type { WebSound } from './web';
import { TimelineNode } from '../main';
import { HTMLAudio } from './html';
import { WebAudio } from './web';
export type PlatformAudio = WebAudio | HTMLAudio;
export type PlatformSound = WebSound | HTMLSound;
export declare class Audio extends TimelineNode {
protected static _soundPool: PlatformSound[];
protected _sounds: PlatformSound[];
/** PlatformAudio */
protected _platformAudio: HTMLAudio | WebAudio;
get platformAudio(): PlatformAudio;
/** Src */
protected _src: string;
get src(): string;
set src(val: string);
isLoaded: boolean;
get isPlayable(): boolean;
/** Duration */
get audioDuration(): number;
/** Volume */
protected _volume: number;
get volume(): number;
set volume(val: number);
/** Muted */
protected _muted: boolean;
get muted(): boolean;
set muted(val: boolean);
/** PlaybackRate */
protected _playbackRate: number;
get playbackRate(): number;
set playbackRate(val: number);
/** IsPlaying */
protected _isPlaying: boolean;
get isPlaying(): boolean;
multiple: boolean;
start: number;
end: number;
constructor(src?: string);
protected _updateProperty(key: string, value: any, oldValue: any): void;
load(): Promise<this>;
pause(): this;
resume(): this;
stop(): this;
play(options?: IPlayOptions): PlatformSound | undefined;
protected _removeSounds(): void;
protected _createSound(): PlatformSound;
refresh(): void;
refreshPaused(): void;
protected _onComplete: (sound: PlatformSound) => void;
protected _recycleSound(sound: PlatformSound): void;
protected _prevTime: number;
protected _timer: number;
protected _process(delta: number): void;
protected _setTimeStop(): void;
}