Link Search Menu Expand Document

WebAudio.d overview

///


Table of contents


utils

WebAudio (class)

The audio object of Web Audio API.

Signature

export declare class WebAudio {
  constructor(url: string)
}

initialize (static method)

Initializes the audio system.

Signature

static initialize(): boolean

setMasterVolume (static method)

Sets the master volume for all audio.

Signature

static setMasterVolume(value: number): void

_createContext (static method)

Signature

static _createContext(): void

_currentTime (static method)

Signature

static _currentTime(): number

_createMasterGainNode (static method)

Signature

static _createMasterGainNode(): void

_setupEventHandlers (static method)

Signature

static _setupEventHandlers(): void

_onUserGesture (static method)

Signature

static _onUserGesture(): void

_onVisibilityChange (static method)

Signature

static _onVisibilityChange(): void

_onHide (static method)

Signature

static _onHide(): void

_onShow (static method)

Signature

static _onShow(): void

_shouldMuteOnHide (static method)

Signature

static _shouldMuteOnHide(): boolean

_resetVolume (static method)

Signature

static _resetVolume(): void

_fadeIn (static method)

Signature

static _fadeIn(duration: number): void

_fadeOut (static method)

Signature

static _fadeOut(duration: number): void

clear (method)

Clears the audio data.

Signature

clear(): void

isReady (method)

Checks whether the audio data is ready to play.

Signature

isReady(): boolean

isError (method)

Checks whether a loading error has occurred.

Signature

isError(): boolean

isPlaying (method)

Checks whether the audio is playing.

Signature

isPlaying(): boolean

play (method)

Plays the audio.

Signature

play(loop: boolean, offset?: number): void

stop (method)

Stops the audio.

Signature

stop(): void

destroy (method)

Destroys the audio.

Signature

destroy(): void

fadeIn (method)

Performs the audio fade-in.

Signature

fadeIn(duration: number): void

fadeOut (method)

Performs the audio fade-out.

Signature

fadeOut(duration: number): void

seek (method)

Gets the seek position of the audio.

Signature

seek(): number

addLoadListener (method)

Adds a callback function that will be called when the audio data is loaded.

Signature

addLoadListener(listner: () => void): void

addStopListener (method)

Adds a callback function that will be called when the playback is stopped.

Signature

addStopListener(listner: () => void): void

retry (method)

Tries to load the audio again.

Signature

retry(): void

_startLoading (method)

Signature

_startLoading(): void

_shouldUseDecoder (method)

Signature

_shouldUseDecoder(): boolean

_createDecoder (method)

Signature

_createDecoder(): void

_destroyDecoder (method)

Signature

_destroyDecoder(): void

_realUrl (method)

Signature

_realUrl(): string

_startXhrLoading (method)

Signature

_startXhrLoading(url: string): void

_startFetching (method)

Signature

_startFetching(url: string): void

_onXhrLoad (method)

Signature

_onXhrLoad(xhr: XMLHttpRequest): void

_onFetch (method)

Signature

_onFetch(response: Response): void

_onError (method)

Signature

_onError(): void

_onFetchProcess (method)

Signature

_onFetchProcess(value: Uint8Array): void

_updateBufferOnFetch (method)

Signature

_updateBufferOnFetch(): void

_concatenateFetchedData (method)

Signature

_concatenateFetchedData(): void

_updateBuffer (method)

Signature

_updateBuffer(): void

_readableBuffer (method)

Signature

_readableBuffer(): ArrayBufferLike

_decodeAudioData (method)

Signature

_decodeAudioData(arrayBuffer: ArrayBuffer): void

_onDecode (method)

Signature

_onDecode(buffer: AudioBuffer): void

_refreshSourceNode (method)

Signature

_refreshSourceNode(): void

_startPlaying (method)

Signature

_startPlaying(offset: number): void

_startAllSourceNodes (method)

Signature

_startAllSourceNodes(): void

_startSourceNode (method)

Signature

_startSourceNode(index: number): void

_stopSourceNode (method)

Signature

_stopSourceNode(): void

_createPannerNode (method)

Signature

_createPannerNode(): void

_createGainNode (method)

Signature

_createGainNode(): void

_createAllSourceNodes (method)

Signature

_createAllSourceNodes(): void

_createSourceNode (method)

Signature

_createSourceNode(index: number): void

_removeNodes (method)

Signature

_removeNodes(): void

_createEndTimer (method)

Signature

_createEndTimer(): void

_removeEndTimer (method)

Signature

_removeEndTimer(): void

_updatePanner (method)

Signature

_updatePanner(): void

_onLoad (method)

Signature

_onLoad(): void

_readLoopComments (method)

Signature

_readLoopComments(arrayBuffer: ArrayBuffer): void

_readMetaData (method)

Signature

_readMetaData(view: DataView, index: number, size: number): void

_readFourCharacters (method)

Signature

_readFourCharacters(view: DataView, index: number): string

name (property)

Signature

name: string

frameCount (property)

Signature

frameCount: number

_url (property)

Signature

_url: string

_data (property)

Signature

_data: Uint8Array | null

_fetchedSize (property)

Signature

_fetchedSize: number

_fetchedData (property)

Signature

_fetchedData: Uint8Array[]

_buffers (property)

Signature

_buffers: AudioBuffer[]

_sourceNodes (property)

Signature

_sourceNodes: AudioBufferSourceNode[]

_gainNode (property)

Signature

_gainNode: GainNode | null

_pannerNode (property)

Signature

_pannerNode: PannerNode | null

_totalTime (property)

Signature

_totalTime: number

_sampleRate (property)

Signature

_sampleRate: number

_loop (property)

Signature

_loop: boolean

_loopStart (property)

Signature

_loopStart: number

_loopLength (property)

Signature

_loopLength: number

_loopStartTime (property)

Signature

_loopStartTime: number

_loopLengthTime (property)

Signature

_loopLengthTime: number

_startTime (property)

Signature

_startTime: number

_volume (property)

Signature

_volume: number

_pitch (property)

Signature

_pitch: number

_pan (property)

Signature

_pan: number

_endTimer (property)

Signature

_endTimer: NodeJS.Timeout | null

_loadListeners (property)

Signature

_loadListeners: (() => void)[]

_stopListeners (property)

Signature

_stopListeners: (() => void)[]

_lastUpdateTime (property)

Signature

_lastUpdateTime: number

_isLoaded (property)

Signature

_isLoaded: boolean

_isError (property)

Signature

_isError: boolean

_isPlaying (property)

Signature

_isPlaying: boolean

_decoder (property)

Signature

_decoder: VorbisDecoder | null