Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for JS to configure ring-buffer size. #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anprogrammer
Copy link

The default buffer sizes chosen, at least in Win32, are extremely
conservative. Sure, a skip in audio will be extremely rare, but for any
type of real-time application (video-games), the audio is near-unusable,
because sounds will play several seconds after the event that triggered
them.

I've exposed the buffer-size fields all the way up to the JS api, so
that the application developer can choose the best balance between
reliability and performance to fit their needs. So far this is only
supported on Win32 (and ignored on other platforms), but I plan on
implementing additional platforms in the future.

The default buffer sizes chosen, at least in Win32, are extremely
conservative.  Sure, a skip in audio will be extremely rare, but for any
type of real-time application (video-games), the audio is near-unusable,
because sounds will play several seconds after the event that triggered
them.

I've exposed the buffer-size fields all the way up to the JS api, so
that the application developer can choose the best balance between
reliability and performance to fit their needs.  So far this is only
supported on Win32 (and ignored on other platforms), but I plan on
implementing additional platforms in the future.
@richsad
Copy link

richsad commented Jul 10, 2014

I desire a similar change for Linux. I would like to use smaller buffers so there is less latency at startup and more immediate stops when end is called.

On Jul 9, 2014, at 9:14 PM, anprogrammer notifications@github.com wrote:

The default buffer sizes chosen, at least in Win32, are extremely
conservative. Sure, a skip in audio will be extremely rare, but for any
type of real-time application (video-games), the audio is near-unusable,
because sounds will play several seconds after the event that triggered
them.

I've exposed the buffer-size fields all the way up to the JS api, so
that the application developer can choose the best balance between
reliability and performance to fit their needs. So far this is only
supported on Win32 (and ignored on other platforms), but I plan on
implementing additional platforms in the future.

You can merge this Pull Request by running

git pull https://github.com/anprogrammer/node-speaker master
Or view, comment on, or merge it at:

#37

Commit Summary

Adds support for JS to configure ring-buffer size.
File Changes

M deps/mpg123/src/audio.h (2)
M deps/mpg123/src/output/win32.c (45)
M index.js (19)
M src/binding.cc (4)
Patch Links:

https://github.com/TooTallNate/node-speaker/pull/37.patch
https://github.com/TooTallNate/node-speaker/pull/37.diff

Reply to this email directly or view it on GitHub.

@watsoncj
Copy link

I just tested this branch on my macbook pro. The example does not play. There is no sound, no errors.

$ node examples/sine.js
generating a 440hz sine wave for 2 seconds

@watsoncj
Copy link

Exit status of the above example is 0.

Can I grab any debug logs to help track this down?

The previous commit (0888eb8) plays fine.

@ewnd9 ewnd9 mentioned this pull request Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants