Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebAudio

Hierarchy

  • WebAudio

Index

Constructors

constructor

Properties

Protected _autoPlay

_autoPlay: boolean

Protected _buffer

_buffer: AudioNode

Protected _endTimer

_endTimer: number

Protected _gainNode

_gainNode: GainNode

Protected _hasError

_hasError: boolean

Protected _loadListeners

_loadListeners: Array<function>

Protected _loopLength

_loopLength: number

Protected _loopStart

_loopStart: number

Protected _pan

_pan: number

Protected _pannerNode

_pannerNode: PannerNode

Protected _pitch

_pitch: number

Protected _sampleRate

_sampleRate: number

Protected _sourceNode

_sourceNode: AudioBufferSourceNode

Protected _startTime

_startTime: number

Protected _stopListeners

_stopListeners: Array<function>

Protected _totalTime

_totalTime: number

Protected _volume

_volume: number

pan

pan: number

The pan of the audio.

property

pan

type

Number

pitch

pitch: number

The pitch of the audio.

property

pitch

type

Number

url

url: string

[read-only] The url of the audio file.

property

url

type

String

volume

volume: number

The volume of the audio.

property

volume

type

Number

Static _context

_context: AudioContext

Static _initialized

_initialized: boolean

Static _masterGainNode

_masterGainNode: GainNode

Static _unlocked

_unlocked: boolean

Methods

Private _connectNodes

  • _connectNodes(): void

Private _createEndTimer

  • _createEndTimer(): void

Private _createNodes

  • _createNodes(): void

Private _load

  • _load(url: string): void

Private _onLoad

  • _onLoad(): void

Private _onXhrLoad

  • _onXhrLoad(xhr: XMLHttpRequest): void

Private _readBigEndian

  • _readBigEndian(array: Uint8Array, index: number): void

Private _readFourCharacters

  • _readFourCharacters(array: Uint8Array, index: number): void

Private _readLittleEndian

  • _readLittleEndian(array: Uint8Array, index: number): void

Private _readLoopComments

  • _readLoopComments(array: Uint8Array): void

Private _readMetaData

  • _readMetaData(array: Uint8Array, index: number, size: number): void

Private _readMp4

  • _readMp4(array: Uint8Array): void

Private _readOgg

  • _readOgg(array: Uint8Array): void

Private _removeEndTimer

  • _removeEndTimer(): void

Private _removeNodes

  • _removeNodes(): void

Private _startPlaying

  • _startPlaying(loop: boolean, offset: number): void

Private _updatePanner

  • _updatePanner(): void

addLoadListener

  • addLoadListener(listner: function): void
  • Add a callback function that will be called when the audio data is loaded.

    method

    addLoadListener

    Parameters

    • listner: function

      The callback function

        • (): void
        • Returns void

    Returns void

addStopListener

  • addStopListener(listner: function): void
  • Add a callback function that will be called when the playback is stopped.

    method

    addStopListener

    Parameters

    • listner: function

      The callback function

        • (): void
        • Returns void

    Returns void

clear

  • clear(): void

fadeIn

  • fadeIn(duration: number): void

fadeOut

  • fadeOut(duration: number): void

isError

  • isError(): boolean

isPlaying

  • isPlaying(): boolean

isReady

  • isReady(): boolean
  • Checks whether the audio data is ready to play.

    method

    isReady

    Returns boolean

    True if the audio data is ready to play

play

  • play(loop: boolean, offset: number): void
  • Plays the audio.

    method

    play

    Parameters

    • loop: boolean

      Whether the audio data play in a loop

    • offset: number

      The start position to play in seconds

    Returns void

seek

  • seek(): void

stop

  • stop(): void

Static Private _createContext

  • _createContext(): void

Static Private _createMasterGainNode

  • _createMasterGainNode(): void

Static Private _detectCodecs

  • _detectCodecs(): void

Static Private _fadeIn

  • _fadeIn(duration: number): void

Static Private _fadeOut

  • _fadeOut(duration: number): void

Static Private _onHide

  • _onHide(): void

Static Private _onShow

  • _onShow(): void

Static Private _onTouchStart

  • _onTouchStart(): void

Static Private _onVisibilityChange

  • _onVisibilityChange(): void

Static Private _setupEventHandlers

  • _setupEventHandlers(): void

Static Private _shouldMuteOnHide

  • _shouldMuteOnHide(): void

Static canPlayM4a

  • canPlayM4a(): boolean
  • Checks whether the browser can play m4a files.

    static
    method

    canPlayM4a

    Returns boolean

    True if the browser can play m4a files

Static canPlayOgg

  • canPlayOgg(): boolean
  • Checks whether the browser can play ogg files.

    static
    method

    canPlayOgg

    Returns boolean

    True if the browser can play ogg files

Static initialize

  • initialize(noAudio?: boolean): boolean
  • Initializes the audio system.

    static
    method

    initialize

    Parameters

    • Optional noAudio: boolean

      Flag for the no-audio mode

    Returns boolean

    True if the audio system is available

Generated using TypeDoc