Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebAudioInstance

Internal class representing a Web Audio AudioBufferSourceNode instance

see

https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API

Hierarchy

  • WebAudioInstance

Implements

Index

Constructors

constructor

  • Parameters

    • _buffer: AudioBuffer

    Returns WebAudioInstance

Properties

Private _buffer

_buffer: AudioBuffer

Private _bufferSource

_bufferSource: AudioBufferSourceNode

Private _currentOffset

_currentOffset: number = 0

Current playback offset (in seconds)

Private _isPaused

_isPaused: boolean = false

Private _isPlaying

_isPlaying: boolean = false

Private _loop

_loop: boolean = false

Private _playingPromise

_playingPromise: Promise<any>

Private _startTime

_startTime: number

Private _volume

_volume: number = 1

Private _volumeNode

_volumeNode: GainNode = audioContext.createGain()

Methods

Private _createBufferSource

  • _createBufferSource(): void
  • Returns void

Private _handleOnEnded

  • _handleOnEnded(): void
  • Returns void

Private _resume

  • _resume(): void
  • Returns void

Private _start

  • _start(): void
  • Returns void

Private _wireUpOnEnded

  • _wireUpOnEnded(): void
  • Returns void

isPlaying

  • isPlaying(): boolean
  • Returns boolean

pause

  • pause(): void
  • Returns void

play

  • Returns Promise<any>

setLoop

  • setLoop(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

setVolume

  • setVolume(value: number): void
  • Parameters

    • value: number

    Returns void

stop

  • stop(): void
  • Returns void