TooTallNate / node-speaker

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

RFC: Consider changing the playback backend to libao #101

Closed ezequielgarcia closed 4 years ago

ezequielgarcia commented 7 years ago

Why?

Ripping off mpg123's playback logic is smart, but it requires maintaining mpg123 as a third-party dependency.

OK, really, why?

To be completely honest, mpg123 failed to output properly with some simple tests. I was wondering how much of a rabbit hole the debugging would be when I remembered that a problem often has many solutions.

Why libao?

Libao is a cross-platform audio library that allows programs to output audio using a simple API on a wide variety of platforms. It currently supports:

The API is really simple.

My proposal

See https://www.npmjs.com/package/libao.

Thanks

Thanks to @TooTallNate for writing node-speaker, from which I took most of the binding code.

TooTallNate commented 7 years ago

This is great!

LinusU commented 7 years ago

Awesome!

ezequielgarcia commented 7 years ago

@TooTallNate so... you guys open to this idea? should I prepare and submit a PR to see how it goes?

I just have Linux systems, so not sure how can we get some mac and windows testing. Also, I'm wondering how much breakage we will get by changing the backend. Maybe we can make it optional (mpg123 or libao, via some build time parameter) for now?

Flowr-es commented 7 years ago

I suggest to make a new major version. Than the switch will be done via semver :)

LinusU commented 7 years ago

I think we should make it a major version, I can test on macOS

dsteinman commented 4 years ago

Whatever happened with this? Is this working? Does it work in Mac, Windows, and Linux??

If your code is working, and is not and will not be merged into the main branch, I'd suggest publishing a new npm package named speaker-libao

ezequielgarcia commented 4 years ago

@dsteinman Sorry, I am no longer working or interested in nodejs. Feel free to pick up this and do whatever you want with it! :)

dsteinman commented 4 years ago

@dsteinman Sorry, I am no longer working or interested in nodejs. Feel free to pick up this and do whatever you want with it! :)

Okay, I may do that. There's a whole bunch of problems with the speaker package and this patch may help. Thanks for writing it!