Closed guest271314 closed 4 years ago
Solved by converting Uint8Array
to JSON
in one context then back to Uint8Array
in a different context
readable
.pipeTo(
new WritableStream({
write: async value => {
externalPort.postMessage(JSON.stringify(value));
},
})
)
if (readable.locked) {
controller.enqueue(Uint8Array.from(Object.values(JSON.parse(message))));
}
Describe the feature Define
TextEncoderStream()
, andTextDecoderStream()
(andTextEncoder
andTextDecoder
) inAudioWorkletGlobalScope
.Is there a prototype?
TextEncoder
,TextDecoder
,TextEncoderStream()
, andTextDecoderStream()
are defined inWindow
andWorker
scope.Describe the feature in more detail
Consider a (potentially infinite) raw PCM stream source from
fetch()
to set asoutputs
withinAudioWorletProcessor.process()
. We need to convert text to aTypedArray
which can be achieved withat
Window
, however throws an error inAudioWorkletGlovbalScope