Closed chrisguttandin closed 4 years ago
In this case an AudioBuffer
does not necessarily need to be created at all https://github.com/guest271314/audioInputToWav/blob/master/index.html#L345. The equivalent of an AudioBuffer
can be an Array
where Array.prototype.find()
and Math.max()
can be utilized to get the maximum value of a float.
Virtual F2F:
OfflineAudioContext
(talked about in #66 but also other issues), at which point the allocation will not be made (and will have to be made by the authors themselves, if needed). This problem then disappears.
Describe the feature It would be nice if the
OfflineAudioContext
could be configured to not allocate any memory for the rendered AudioBuffer in case it is not needed.Is there a prototype? No.
Describe the feature in more detail Sometimes an
OfflineAudioContext
is only used to compute a side effect and not really for rendering a buffer.Let's imagine you have an
AudioWorkletNode
which just scans the signal for its maximum value. Its usage might look like this:In the example above the
OfflineAudioContext
is only used to drive the processing of the data but the rendered buffer is not really needed. I think it would be beneficial if the buffer doesn't need to be created in any case.