@flashport/flashport
Version:
FlashPort is a TypeScript 2D graphics library that largely replicates the Flash ActionScript 3.0 library
52 lines (51 loc) • 1.76 kB
TypeScript
import { SoundTransform } from "./SoundTransform";
import { SoundLoaderContext } from "./SoundLoaderContext";
import { SoundChannel } from "./SoundChannel";
import { ID3Info } from "./ID3Info";
import { EventDispatcher } from "../events/EventDispatcher";
import { URLRequest } from "../net/URLRequest";
import { ByteArray } from "../utils/ByteArray";
export declare class Sound extends EventDispatcher {
static sounds: any[];
private xhr;
private buffer;
private static _ctx;
playing: boolean;
private loops;
private _sndTransform;
private startTime;
private _stream;
private _context;
source: AudioBufferSourceNode;
private panNode;
private gainNode;
private channel;
private _envelops;
constructor(stream?: URLRequest, context?: SoundLoaderContext);
load(stream: URLRequest, context?: SoundLoaderContext): void;
loadCompressedDataFromByteArray(bytes: ByteArray, bytesLength: number): void;
loadPCMFromByteArray(bytes: ByteArray, samples: number, format?: string, stereo?: boolean, sampleRate?: number): void;
private _buildLoaderContext;
private _load;
private xhr_load;
private decodeAudioDataSuccess;
get url(): string;
get isURLInaccessible(): boolean;
play(startTime?: number, loops?: number, sndTransform?: SoundTransform): SoundChannel;
get length(): number;
get isBuffering(): boolean;
get bytesLoaded(): number;
get bytesTotal(): number;
get id3(): ID3Info;
static get ctx(): AudioContext;
close(): void;
extract(target: ByteArray, length: number, startPosition?: number): number;
/**
* Animate only
*/
get __envelops(): any[];
/**
* Animate only
*/
set __envelops(value: any[]);
}