| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@LinusU @TooTallNate @Mexxxo Bringing this to your attention. Any help testing is much appreciated. Sorry for the delay, I had to take care of merging proper dlopen support for libao plugins to work everywhere. It happened in nodejs/node#12794, and got included in node 9. |
Sorry, something went wrong.
|
This is pretty cool @ezequielgarcia, great work! |
Sorry, something went wrong.
This commit is quite invasive, but results in a much more simplified code, by using libao's simpler API. Moreover, mpg123 was having issues and not always playing correctly, requiring extra (and annoying) care. Reference: TooTallNate#101 Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
libao refuses to work with 0-bytes buffers. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
| ## Installation | ||
|
|
||
| Simply compile and install `node-speaker` using `npm`: | ||
| You need `libao` installed on your system before installig `node-speaker`. |
There was a problem hiding this comment.
This is possibly a bit of a drawback, I kind of liked the approach of bundling the source to the lib.
How do we feel about just adding the libao source code to this repo?
Sorry, something went wrong.
There was a problem hiding this comment.
Hum, well, I always thought bundling was a Bad Idea, but I see your point about ease of use. So, I've done some thinking and reviewing my stand on bundling dependencies.
The whole point of switching to libao is to avoid bundled sources. The tl;dr version of why is because once you bundle the sources, you kind of own the dependency and get all the maintenance burden (which we already have, as the issues show). On the other side, proper external dependencies allow us to report issues in the right place and let the proper owners deal with it.
It is comforting for users, but I'm not willing the pay the price.
Sorry, something went wrong.
|
Haven't had time to look at it properly, but it seems awesome 👍 |
Sorry, something went wrong.
|
Hi, I will try it this weekend and provide some feedback |
Sorry, something went wrong.
|
@ezequielgarcia finally I have tested your PR. I integrated it into a working system that used the speaker with mpg123 and the only diffenrence is now that the sound sometimes has a minimal delay (100ms) <--- I guess this is related to the not available (internal) method to flush the speaker. I actually found this a lack of the current module that it is not possible to immediatly stop the speaker, is it possible to include a method in this module? Things I have found: the links for Bugs and Homepage in the package.json are not pointing to the destination repo ;) That needs to be changed for accepting the PR. Also I would suggest to add a contributors array of LinusU and you, as you both are taking care of this, you deserve some props 👍 I tested it with node 6 on a raspberry pi. The package gets not installed if libao has not been installed before. Is it possible to improve the error message? Currently the only meaningful in the 50 lines of error is one line that says "no package ao found". |
Sorry, something went wrong.
|
Also an entry in the history.md is missing |
Sorry, something went wrong.
|
So I have your libao PR now since a month in use on my raspi. Till now I have not observed any reproducible way for this issue. Once I know more I will let you know. |
Sorry, something went wrong.
|
Hi guys @LinusU @TooTallNate @Mexxxo ! Sorry for the huge delay: new job, lots to do. I have spent quite a bit of time re-considering this PR, and re-considering libao in particular. Leaving aside @Mexxxo's issues, I am now changing my mind regarding libao. My biggest concern is that it seems kind of dead, kind of unmaintained. Last official release was v1.2.0 - January 27, 2014. There is some activity on github, last commit was in January, 2018. I am under the impression that mpg123 is slightly more maintained (although since we are bundling here, it means manual syncing is required). In the end, it seems nor mpg123, neither libao is super maintained, and that both come with their own set of issues. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As already discussed in RFC #101 , here is my proposal to ditch mpg123 and use libao instead. Carrying mpg123 meant maintaining it as a dependency, tracking down fixes, and worrying about potential upstreaming of changes or API changes.
On the other hand, with libao as backend we can keep it as an external binary dependency, and not worry about maintaining it. libao is a good match for node-speaker given its multiplatform support. Also, the API is very simple, which also matches node-speaker simple needs.
This PR removes some module exported functions, which are no longer meaningful with libao as backend:
Tested with pulseaudio plugin on Archlinux. All tests passes:
$ npm test exports ✓ should export a Function Speaker ✓ should return a Speaker instance ✓ should be a writable stream ✓ should emit an "open" event after the first write() ✓ should emit a "close" event after end() ✓ should only emit one "close" event 6 passing (34ms)