Pipe something into a AudioReceiveStream

I'm trying to pipe a stream into an AudioReceiveStream:
let opusStream = new AudioReceiveStream({
end: EndBehaviorType.Manual
});
let someAudioStream = connection.receiver.subscribe('User ID', { end: { behavior: EndBehaviorType.AfterSilence, duration: 200 } });
someAudioStream.pipe(opusStream);
let opusStream = new AudioReceiveStream({
end: EndBehaviorType.Manual
});
let someAudioStream = connection.receiver.subscribe('User ID', { end: { behavior: EndBehaviorType.AfterSilence, duration: 200 } });
someAudioStream.pipe(opusStream);
However, I get the error:
node:internal/streams/readable:766
const ret = dest.write(chunk);
^

TypeError: dest.write is not a function
at AudioReceiveStream.ondata (node:internal/streams/readable:766:22)
at AudioReceiveStream.emit (node:events:525:35)
at Readable.read (node:internal/streams/readable:539:10)
at flow (node:internal/streams/readable:1023:34)
at resume_ (node:internal/streams/readable:1004:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
node:internal/streams/readable:766
const ret = dest.write(chunk);
^

TypeError: dest.write is not a function
at AudioReceiveStream.ondata (node:internal/streams/readable:766:22)
at AudioReceiveStream.emit (node:events:525:35)
at Readable.read (node:internal/streams/readable:539:10)
at flow (node:internal/streams/readable:1023:34)
at resume_ (node:internal/streams/readable:1004:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
I am very new to streams as you can probably tell by my previous posts. Anyways, do I have to do that differently / how can I pipe something into an AudioReceiveStream?
2 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Jiron
JironOP2y ago
[email protected], node v18.14.1
Want results from more Discord servers?
Add your server