TooTallNate / node-speaker

Output PCM audio data to the speakers
648 stars 145 forks source link

Best way to play multiple input streams #115

Closed mhammerc closed 6 years ago

mhammerc commented 6 years ago

Hello!

I want to play multiple PCM streams. Let's say I can maximum play 5 streams at the same time. What's the best ?

Thanks!

LinusU commented 6 years ago

Did you find an answer to this? :)

My gut feeling is that it’s better to let the system do the mixing instead of Node, but I might be wrong.

Also, mixing in Node.js would avoid crossing the JS/C++ boundary once for each chunk of each stream, so that could be beneficial...

mhammerc commented 6 years ago

Hello Linus ! I tried mixing from node, but I got segfaults on pipe close, as far as I remember. So I tried node-mpg123 but we were suffering a bit of latency.

Instead, we developped our own Rust solution based on rodio: node-rodio !