Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
resampler.on('data', (data) => {
data = toArrayBuffer(data) // postMessage can't transfer node's Buffer
postMessage({
voiceId: voiceId,
target: target,
buffer: data
}, [data])
}).on('end', () => {
postMessage({
write (chunk, encoding, callback) {
chunk = toArrayBuffer(chunk)
connector._postMessage({
voiceId: voiceId,
chunk: chunk
})
callback()
},
final (callback) {