Open acceptable-security opened 9 years ago
Can you share the code you use to pause it?
stopSound: function (player, buffer, decoder) {
buffer.pause();
buffer.unpipe(decoder);
decoder.unpipe(player);
decoder.end();
// player.end();
}
where player is a writable stream, decoder is a read and writable stream, and buffer is a readable stream. (the buffer streams into decoder which streams into player). buffer is the torrent-stream.
Trying to pause the read stream will not only not happen instantly but also sometimes it'll keep reading and resuming the buffer will start later in the stream.