node-stream-throttle icon indicating copy to clipboard operation
node-stream-throttle copied to clipboard

Initial burst

Open AlekseyMartynov opened this issue 10 years ago • 5 comments

In some applications (such as media streaming), it's desirable to send the beginning of a stream at a maximum rate to quickly fill client buffers. Similar to http://stackoverflow.com/a/32874710.

AlekseyMartynov avatar Dec 21 '15 21:12 AlekseyMartynov

Any solution for this ? I like to throttle an mp3 stream with init burst

daslicht avatar Mar 12 '16 13:03 daslicht

@daslicht I implemented this using throuhg2. Code: throttle.js. Usage: see server.js.

AlekseyMartynov avatar Mar 12 '16 16:03 AlekseyMartynov

Awesome ! Thank you very much I am going to try it !

daslicht avatar Mar 12 '16 18:03 daslicht

Works like a charm ! Thank you very much !

daslicht avatar Mar 14 '16 12:03 daslicht

The above code links are now throttle.js and server.js

After converting that to CoffeeScript I looked at it and realized it probably can't work for me. I'm throttling an audio stream before encoding it so that it's realtime, before sending the encoded data to multiple clients. I can't just add an extra throttle per client because it can't undo the original throttling.

I managed to solve this with a simple initial burst from an array of chunks. I might make it into a module.

1j01 avatar Oct 31 '16 04:10 1j01