[英]How to stop a stream after .pipe()?
const speaker = new Speaker({
channels: 2,
bitDepth: 16,
sampleRate: 44100,
device: null,
});
stream.pipe(speaker);
I need it for break playing sound.我需要它来中断播放声音。 Stream is instance of Readable. Stream 是可读的实例。
stream.pipeline
which claims to handle “forwarding errors and properly cleaning up and provide a callback when the pipeline is complete.” stream.pipeline
声称可以处理“转发错误并正确清理并在管道完成时提供回调”。
Syntax句法
stream.pipeline(...streams, callback)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.