Mark functions incompatible with SharedArrayBuffer
and provide alternative signatures
#3772
Labels
SharedArrayBuffer
and provide alternative signatures
#3772
Presently browser's will crash if
copyToChannel(source, channelNumber)
is called with a Float32Array that is backed by a SharedArrayBuffer. I opened an issue on that here: WebAudio/web-audio-api#2565While the browser's
copyToChannel
function accepts aFloat32Array
as thesource
argumentweb-sys
instead takes in a&[f32]
. This is likely for convenience but it also makes it impossible to useweb_sys
'scopy_to_channel
in cases where theFloat32Array
was acquired from a source that's not the Wasm instance's memory. This seems like an API oversight to me.This limitation means that if the memory is backed by a SharedArrayBuffer
copy_to_channel
simply cannot be used without causing a crash.That makes workarounds, like the one required for this issue: RustAudio/cpal#656, a little messier.
Workarounds are possible but it also seems like the
web_sys
API should consider changing.The text was updated successfully, but these errors were encountered: