JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.javascript.host.media

Class BaseAudioContext

    • Constructor Detail

      • BaseAudioContext

        public BaseAudioContext()
    • Method Detail

      • createBufferSource

        public AudioBufferSourceNode createBufferSource()
        Returns:
        a new AudioBufferSourceNode, which can be used to play audio data contained within an AudioBuffer object.
      • createBuffer

        public AudioBuffer createBuffer()
        Returns:
        new, empty AudioBuffer object, which can then be populated by data, and played via an AudioBufferSourceNode.
      • createGain

        public GainNode createGain()
        Returns:
        a GainNode, which can be used to control the overall gain (or volume) of the audio graph.
      • decodeAudioData

        public org.htmlunit.corejs.javascript.NativePromise decodeAudioData(org.htmlunit.corejs.javascript.typedarrays.NativeArrayBuffer buffer,
         org.htmlunit.corejs.javascript.Function success,
         org.htmlunit.corejs.javascript.Function error)
        The decodeAudioData() method of the BaseAudioContext Interface is used to asynchronously decode audio file data contained in an ArrayBuffer. In this case the ArrayBuffer is loaded from XMLHttpRequest and FileReader. The decoded AudioBuffer is resampled to the AudioContext's sampling rate, then passed to a callback or promise.
        Parameters:
        buffer - An ArrayBuffer containing the audio data to be decoded, usually grabbed from XMLHttpRequest, WindowOrWorkerGlobalScope.fetch() or FileReader
        success - A callback function to be invoked when the decoding successfully finishes. The single argument to this callback is an AudioBuffer representing the decodedData (the decoded PCM audio data). Usually you'll want to put the decoded data into an AudioBufferSourceNode, from which it can be played and manipulated how you want.
        error - An optional error callback, to be invoked if an error occurs when the audio data is being decoded.
        Returns:
        the promise or null
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /