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

Add support for selecting output audio device in Windows (win32 module) #154

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

nacgarg
Copy link
Contributor

@nacgarg nacgarg commented Sep 14, 2020

Previously, the win32 output module would always use the default output device (WAVE_MAPPER). To support selecting non-default output devices, this PR will enumerate all output devices and pick the device with the same name as ao->device. The name comes from the szPname field in WAVEOUTCAPS which is limited to 32 characters (including null sentinel). This means that to select an audio device such as Speakers (High Definition Audio Device), ao->device must be truncated to the first 31 characters of that followed by the null byte.

@daytonellwanger
Copy link

@LinusU @nacgarg could we get a review on this? There are many uses where the default device isn't the appropriate device to use and the user needs the ability to select the desired output device. Not having the ability to change the output device makes this package unusable for these use cases.

@daytonellwanger
Copy link

@LinusU is there someone else we should tag to take a look at this change? Are changes like this still being accepted to this project? Or should I create and publish a fork if I need this behavior?

@nacgarg
Copy link
Contributor Author

nacgarg commented Oct 26, 2021

@daytonellwanger Wow, I just realized it's been over a year without any response from the maintainers, so I appreciate you bumping this PR. I'd welcome any feedback about this change and will fix any issues that come up so that we can get this merged in. In the meantime, I've been using my fork with npm by adding "speaker": "https://github.com/nacgarg/node-speaker" to package.json.

@LinusU
Copy link
Collaborator

LinusU commented Mar 16, 2022

Sorry for the very long delay here. I cannot personally test this, but I will merge and release this since it seems that multiple people have reacted positively to this PR, and since the code looks straight forward enough.

@LinusU LinusU merged commit 6f450c1 into TooTallNate:master Mar 16, 2022
@LinusU
Copy link
Collaborator

LinusU commented Mar 16, 2022

Released as 🚢 0.5.4 / 2022-03-16!

Again, sorry for the delay 🙏

@daytonellwanger
Copy link

Thanks @LinusU ! Much appreciated 🙏

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.

None yet

3 participants