Class AudioContext

Hierarchy

Implements

Constructors

  • Returns AudioContext

Properties

baseLatency: number
onstatechange: null | ((this, ev) => any)

Type declaration

outputLatency: number

Accessors

  • get audioWorklet(): AudioWorklet
  • Returns AudioWorklet

  • get currentTime(): number
  • Returns number

  • get destination(): AudioDestinationNode
  • Returns AudioDestinationNode

  • get listener(): AudioListener
  • Returns AudioListener

  • get sampleRate(): number
  • A floating point number indicating the audio context's sample rate, in samples per second.

    Returns number

Methods

  • Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.

    The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture.

    When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET.

    When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.

    When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed.

    If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted.

    The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture.

    Parameters

    Returns void

  • Parameters

    • numberOfChannels: number
    • length: number
    • sampleRate: number

    Returns AudioBuffer

  • Parameters

    • Optional maxDelayTime: number

    Returns DelayNode

  • Parameters

    • feedforward: number[]
    • feedback: number[]

    Returns IIRFilterNode

  • Parameters

    • feedforward: Iterable<number>
    • feedback: Iterable<number>

    Returns IIRFilterNode

  • Parameters

    Returns PeriodicWave

  • Parameters

    • real: Iterable<number>
    • imag: Iterable<number>
    • Optional constraints: PeriodicWaveConstraints

    Returns PeriodicWave

  • Parameters

    • Optional bufferSize: number
    • Optional numberOfInputChannels: number
    • Optional numberOfOutputChannels: number

    Returns ScriptProcessorNode

  • Parameters

    • audioData: ArrayBuffer
    • Optional successCallback: null | DecodeSuccessCallback
    • Optional errorCallback: null | DecodeErrorCallback

    Returns Promise<AudioBuffer>

  • Suspends the progression of time in the audio context, temporarily halting audio hardware access and reducing CPU/battery usage in the process — this is useful if you want an application to power down the audio hardware when it will not be using an audio context for a while.

    Returns Promise<void>

Generated using TypeDoc