OfflineAudioContext
Values
addEventListener
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. Read more on MDN
let addEventListener: ( WebAPI.WebAudioTypes.offlineAudioContext, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>, ~options: WebAPI.DOM.EventListener.addEventListenerOptions=?,) => unitParameters
Return type
unitaddEventListenerWithCapture
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. Read more on MDN
let addEventListenerWithCapture: ( WebAPI.WebAudioTypes.offlineAudioContext, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>,) => unitParameters
Return type
unitasBaseAudioContext
let asBaseAudioContext: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.baseAudioContextasEventTarget
let asEventTarget: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.DOM.eventTargetcreateAnalyser
let createAnalyser: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.analyserNodeParameters
Return type
WebAPI.WebAudioTypes.analyserNodecreateBiquadFilter
let createBiquadFilter: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.biquadFilterNodeParameters
Return type
WebAPI.WebAudioTypes.biquadFilterNodecreateBuffer
let createBuffer: ( WebAPI.WebAudioTypes.offlineAudioContext, ~numberOfChannels: int, ~length: int, ~sampleRate: float,) => WebAPI.WebAudioTypes.audioBufferParameters
Return type
WebAPI.WebAudioTypes.audioBuffercreateBufferSource
let createBufferSource: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.audioBufferSourceNodeParameters
Return type
WebAPI.WebAudioTypes.audioBufferSourceNodecreateChannelMerger
let createChannelMerger: ( WebAPI.WebAudioTypes.offlineAudioContext, ~numberOfInputs: int=?,) => WebAPI.WebAudioTypes.channelMergerNodeParameters
Return type
WebAPI.WebAudioTypes.channelMergerNodecreateChannelSplitter
let createChannelSplitter: ( WebAPI.WebAudioTypes.offlineAudioContext, ~numberOfOutputs: int=?,) => WebAPI.WebAudioTypes.channelSplitterNodeParameters
Return type
WebAPI.WebAudioTypes.channelSplitterNodecreateConstantSource
let createConstantSource: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.constantSourceNodeParameters
Return type
WebAPI.WebAudioTypes.constantSourceNodecreateConvolver
let createConvolver: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.convolverNodeParameters
Return type
WebAPI.WebAudioTypes.convolverNodecreateDelay
let createDelay: ( WebAPI.WebAudioTypes.offlineAudioContext, ~maxDelayTime: float=?,) => WebAPI.WebAudioTypes.delayNodeParameters
Return type
WebAPI.WebAudioTypes.delayNodecreateDynamicsCompressor
let createDynamicsCompressor: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.dynamicsCompressorNodeParameters
Return type
WebAPI.WebAudioTypes.dynamicsCompressorNodecreateGain
let createGain: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.gainNodeParameters
Return type
WebAPI.WebAudioTypes.gainNodecreateIIRFilter
let createIIRFilter: ( WebAPI.WebAudioTypes.offlineAudioContext, ~feedforward: array<float>, ~feedback: array<float>,) => WebAPI.WebAudioTypes.iirFilterNodeParameters
Return type
WebAPI.WebAudioTypes.iirFilterNodecreateOscillator
let createOscillator: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.oscillatorNodeParameters
Return type
WebAPI.WebAudioTypes.oscillatorNodecreatePanner
let createPanner: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.pannerNodeParameters
Return type
WebAPI.WebAudioTypes.pannerNodecreatePeriodicWave
let createPeriodicWave: ( WebAPI.WebAudioTypes.offlineAudioContext, ~real: array<float>, ~imag: array<float>, ~constraints: WebAPI.WebAudioTypes.periodicWaveConstraints=?,) => WebAPI.WebAudioTypes.periodicWaveParameters
Return type
WebAPI.WebAudioTypes.periodicWavecreateStereoPanner
let createStereoPanner: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.stereoPannerNodeParameters
Return type
WebAPI.WebAudioTypes.stereoPannerNodecreateWaveShaper
let createWaveShaper: WebAPI.WebAudioTypes.offlineAudioContext => WebAPI.WebAudioTypes.waveShaperNodeParameters
Return type
WebAPI.WebAudioTypes.waveShaperNodedecodeAudioData
let decodeAudioData: ( WebAPI.WebAudioTypes.offlineAudioContext, ~audioData: ArrayBuffer.t, ~successCallback: WebAPI.WebAudioTypes.decodeSuccessCallback=?, ~errorCallback: WebAPI.WebAudioTypes.decodeErrorCallback=?,) => promise<WebAPI.WebAudioTypes.audioBuffer>Parameters
Return type
promise<WebAPI.WebAudioTypes.audioBuffer>dispatchEvent
Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. Read more on MDN
let dispatchEvent: ( WebAPI.WebAudioTypes.offlineAudioContext, WebAPI.DOM.event,) => boolfromChannelCountLengthAndSampleRate
fromChannelCountLengthAndSampleRate(~numberOfChannels: int, ~length: int, ~sampleRate: float)
Creates a new OfflineAudioContext from explicit channel, length, and sample-rate values.
let context =
OfflineAudioContext.fromChannelCountLengthAndSampleRate(
~numberOfChannels=2,
~length=44_100,
~sampleRate=44_100.,
)
let fromChannelCountLengthAndSampleRate: ( ~numberOfChannels: int, ~length: int, ~sampleRate: float,) => WebAPI.WebAudioTypes.offlineAudioContextParameters
Return type
WebAPI.WebAudioTypes.offlineAudioContextfromOptions
fromOptions(offlineAudioContextOptions)
Creates a new OfflineAudioContext from offlineAudioContextOptions.
let context = OfflineAudioContext.fromOptions(myOfflineAudioContextOptions)
let fromOptions: WebAPI.WebAudioTypes.offlineAudioContextOptions => WebAPI.WebAudioTypes.offlineAudioContextParameters
Return type
WebAPI.WebAudioTypes.offlineAudioContextremoveEventListener
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
let removeEventListener: ( WebAPI.WebAudioTypes.offlineAudioContext, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>, ~options: WebAPI.DOM.EventListener.options=?,) => unitParameters
Return type
unitremoveEventListenerUseCapture
Removes the event listener in target's event listener list with the same type, callback, and options. Read more on MDN
let removeEventListenerUseCapture: ( WebAPI.WebAudioTypes.offlineAudioContext, WebAPI.EventType.t, WebAPI.DOM.EventListener.t<'event>,) => unitParameters
Return type
unitresume
let resume: WebAPI.WebAudioTypes.offlineAudioContext => promise<unit>Parameters
Return type
promise<unit>startRendering
let startRendering: WebAPI.WebAudioTypes.offlineAudioContext => promise< WebAPI.WebAudioTypes.audioBuffer,>Parameters
Return type
promise<WebAPI.WebAudioTypes.audioBuffer>suspend
let suspend: ( WebAPI.WebAudioTypes.offlineAudioContext, float,) => promise<unit>