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: ( WebAudioTypes.offlineAudioContext, EventTypes.eventType, EventTypes.eventListener<'event>, ~options: EventTypes.addEventListenerOptions=?,) => unitParameters
WebAudioTypes.offlineAudioContext EventTypes.eventType EventTypes.eventListener option< EventTypes.addEventListenerOptions >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: ( WebAudioTypes.offlineAudioContext, EventTypes.eventType, EventTypes.eventListener<'event>,) => unitParameters
WebAudioTypes.offlineAudioContext EventTypes.eventType EventTypes.eventListenerReturn type
unitasBaseAudioContext
let asBaseAudioContext: WebAudioTypes.offlineAudioContext => WebAudioTypes.baseAudioContextParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.baseAudioContextasEventTarget
let asEventTarget: WebAudioTypes.offlineAudioContext => EventTypes.eventTargetParameters
WebAudioTypes.offlineAudioContextReturn type
EventTypes.eventTargetcreateAnalyser
let createAnalyser: WebAudioTypes.offlineAudioContext => WebAudioTypes.analyserNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.analyserNodecreateBiquadFilter
let createBiquadFilter: WebAudioTypes.offlineAudioContext => WebAudioTypes.biquadFilterNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.biquadFilterNodecreateBuffer
let createBuffer: ( WebAudioTypes.offlineAudioContext, ~numberOfChannels: int, ~length: int, ~sampleRate: float,) => WebAudioTypes.audioBufferParameters
WebAudioTypes.offlineAudioContext int int floatReturn type
WebAudioTypes.audioBuffercreateBufferSource
let createBufferSource: WebAudioTypes.offlineAudioContext => WebAudioTypes.audioBufferSourceNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.audioBufferSourceNodecreateChannelMerger
let createChannelMerger: ( WebAudioTypes.offlineAudioContext, ~numberOfInputs: int=?,) => WebAudioTypes.channelMergerNodeParameters
WebAudioTypes.offlineAudioContext option< int >Return type
WebAudioTypes.channelMergerNodecreateChannelSplitter
let createChannelSplitter: ( WebAudioTypes.offlineAudioContext, ~numberOfOutputs: int=?,) => WebAudioTypes.channelSplitterNodeParameters
WebAudioTypes.offlineAudioContext option< int >Return type
WebAudioTypes.channelSplitterNodecreateConstantSource
let createConstantSource: WebAudioTypes.offlineAudioContext => WebAudioTypes.constantSourceNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.constantSourceNodecreateConvolver
let createConvolver: WebAudioTypes.offlineAudioContext => WebAudioTypes.convolverNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.convolverNodecreateDelay
let createDelay: ( WebAudioTypes.offlineAudioContext, ~maxDelayTime: float=?,) => WebAudioTypes.delayNodeParameters
WebAudioTypes.offlineAudioContext option< float >Return type
WebAudioTypes.delayNodecreateDynamicsCompressor
let createDynamicsCompressor: WebAudioTypes.offlineAudioContext => WebAudioTypes.dynamicsCompressorNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.dynamicsCompressorNodecreateGain
let createGain: WebAudioTypes.offlineAudioContext => WebAudioTypes.gainNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.gainNodecreateIIRFilter
let createIIRFilter: ( WebAudioTypes.offlineAudioContext, ~feedforward: array<float>, ~feedback: array<float>,) => WebAudioTypes.iirFilterNodeParameters
WebAudioTypes.offlineAudioContext array< float > array< float >Return type
WebAudioTypes.iirFilterNodecreateOscillator
let createOscillator: WebAudioTypes.offlineAudioContext => WebAudioTypes.oscillatorNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.oscillatorNodecreatePanner
let createPanner: WebAudioTypes.offlineAudioContext => WebAudioTypes.pannerNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.pannerNodecreatePeriodicWave
let createPeriodicWave: ( WebAudioTypes.offlineAudioContext, ~real: array<float>, ~imag: array<float>, ~constraints: WebAudioTypes.periodicWaveConstraints=?,) => WebAudioTypes.periodicWaveParameters
WebAudioTypes.offlineAudioContext array< float > array< float > option< WebAudioTypes.periodicWaveConstraints >Return type
WebAudioTypes.periodicWavecreateStereoPanner
let createStereoPanner: WebAudioTypes.offlineAudioContext => WebAudioTypes.stereoPannerNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.stereoPannerNodecreateWaveShaper
let createWaveShaper: WebAudioTypes.offlineAudioContext => WebAudioTypes.waveShaperNodeParameters
WebAudioTypes.offlineAudioContextReturn type
WebAudioTypes.waveShaperNodedecodeAudioData
let decodeAudioData: ( WebAudioTypes.offlineAudioContext, ~audioData: ArrayBuffer.t, ~successCallback: WebAudioTypes.decodeSuccessCallback=?, ~errorCallback: WebAudioTypes.decodeErrorCallback=?,) => promise<WebAudioTypes.audioBuffer>Parameters
WebAudioTypes.offlineAudioContext Stdlib.ArrayBuffer.t option< WebAudioTypes.decodeSuccessCallback > option< WebAudioTypes.decodeErrorCallback >Return type
promise< 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: ( WebAudioTypes.offlineAudioContext, EventTypes.event,) => boolParameters
WebAudioTypes.offlineAudioContext EventTypes.eventReturn type
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,) => WebAudioTypes.offlineAudioContextParameters
int int floatReturn type
WebAudioTypes.offlineAudioContextfromOptions
fromOptions(offlineAudioContextOptions)
Creates a new OfflineAudioContext from offlineAudioContextOptions.
let context = OfflineAudioContext.fromOptions(myOfflineAudioContextOptions)
let fromOptions: WebAudioTypes.offlineAudioContextOptions => WebAudioTypes.offlineAudioContextParameters
WebAudioTypes.offlineAudioContextOptionsReturn type
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: ( WebAudioTypes.offlineAudioContext, EventTypes.eventType, EventTypes.eventListener<'event>, ~options: EventTypes.eventListenerOptions=?,) => unitParameters
WebAudioTypes.offlineAudioContext EventTypes.eventType EventTypes.eventListener option< EventTypes.eventListenerOptions >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: ( WebAudioTypes.offlineAudioContext, EventTypes.eventType, EventTypes.eventListener<'event>,) => unitParameters
WebAudioTypes.offlineAudioContext EventTypes.eventType EventTypes.eventListenerReturn type
unitresume
let resume: WebAudioTypes.offlineAudioContext => promise<unit>Parameters
WebAudioTypes.offlineAudioContextReturn type
promise< unit >startRendering
let startRendering: WebAudioTypes.offlineAudioContext => promise< WebAudioTypes.audioBuffer,>Parameters
WebAudioTypes.offlineAudioContextReturn type
promise< WebAudioTypes.audioBuffer >suspend
let suspend: (WebAudioTypes.offlineAudioContext, float) => promise<unit>