import { AudioListener } from './audioListener'; /** * Create a audio object. * This uses the Web Audio API. */ export declare class Audio { /** Whether to start playback automatically. Default is false. */ autoplay: boolean; /** The AudioContext of the listener given in the constructor. */ context: AudioContext; /** Modify pitch, measured in cents. +/- 100 is a semitone. +/- 1200 is an octave. Default is 0. */ detune: number; /** Overrides the duration of the audio. Same as the duration parameter of AudioBufferSourceNode.start(). Default is undefined to play the whole buffer. */ duration: number | undefined; /** Represents an array of BiquadFilterNodes. Can be used to apply a variety of low-order filters to create more complex sound effects. Filters are set via Audio.setFilter or Audio.setFilters. */ filters: BiquadFilterNode[]; /** A GainNode created using AudioContext.createGain(). */ gain: GainNode; /** Whether playback can be controlled using the play(), pause() etc. methods. Default is true. */ hasPlaybackControl: boolean; /** Whether the audio is currently playing. */ isPlaying: boolean; /** A reference to the listener object of this audio. */ listener: AudioListener; /** An offset to the time within the audio buffer that playback should begin. Same as the offset parameter of AudioBufferSourceNode.start(). Default is 0. */ offset: number; /** Speed of playback. Default is 1. */ playbackRate: number; /** An AudioBufferSourceNode created using AudioContext.createBufferSource(). */ source: AudioBufferSourceNode | null; /** Type of the audio source. Default is string 'empty'. */ sourceType: string; /** String denoting the type, set to 'Audio'. */ type: string; private buffer; private loop; private loopEnd; private loopStart; private _connected; private _progress; private _startedAt; /** * @param listener [AudioListener](https://threejs.org/docs/#api/en/audio/AudioListener) instance. */ constructor(listener: AudioListener); /** Return the gainNode. */ getOutput(): GainNode; /** * Setup the source to the audioBuffer, and sets sourceType to 'audioNode'. * Also sets hasPlaybackControl to false. */ setNodeSource(audioNode: AudioBufferSourceNode): this; /** * Applies the given object of type HTMLMediaElement as the source of this audio. * Also sets hasPlaybackControl to false. */ setMediaElementSource(mediaElement: HTMLMediaElement): this; /** * Applies the given object of type MediaStream as the source of this audio. * Also sets hasPlaybackControl to false. */ setMediaStreamSource(mediaStream: MediaStream): this; /** * Setup the source to the audioBuffer, and sets sourceType to 'buffer'. * If autoplay, also starts playback. */ setBuffer(audioBuffer: AudioBuffer): this; /** If hasPlaybackControl is true, starts playback. */ play(delay?: number): this | undefined; /** If hasPlaybackControl is true, pauses playback. */ pause(): this | undefined; /** If hasPlaybackControl is enabled, stops playback. */ stop(): this | undefined; /** Connect to the Audio.source. This is used internally on initialisation and when setting / removing filters. */ connect(): this; /** Disconnect from the Audio.source. This is used internally when setting / removing filters. */ disconnect(): this; /** Returns the filters array. */ getFilters(): BiquadFilterNode[]; /** * value - arrays of filters. * Applies an array of BiquadFilterNodes to the audio. */ setFilters(value: BiquadFilterNode[]): this; /** Returns the first element of the filters array. */ getFilter(): BiquadFilterNode; /** Applies a single BiquadFilterNode to the audio. */ setFilter(filter: BiquadFilterNode): this; /** If hasPlaybackControl is enabled, set the playbackRate to value. */ setPlaybackRate(value: number): this | undefined; /** Return the value of playbackRate. */ getPlaybackRate(): number; /** Called automatically when playback finished. */ onEnded(): void; /** Return the value of source.loop (whether playback should loop). */ getLoop(): boolean; /** Set source.loop to value (whether playback should loop). */ setLoop(value: boolean): this | undefined; /** Set source.loopStart to value. */ setLoopStart(value: number): this; /** Set source.loopEnd to value. */ setLoopEnd(value: number): this; /** Return the current volume. */ getVolume(): number; /** Set the volume. */ setVolume(value: number): this; private setDetune; private getDetune; } //# sourceMappingURL=audio.d.ts.map