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

WASAPI multi-channel microphone input #55

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

SleeeepyZhou
Copy link

@SleeeepyZhou SleeeepyZhou commented Oct 2, 2024

Support multi-channel microphone input by downmixing to stereo

  • Enhanced the WASAPI audio driver to support microphones with any number of channels.
  • This modification ensures compatibility with a broader range of multi-channel microphones, allowing for more versatile input handling in engine.
  • Regarding “WASAPI: unsupported channel count in microphone!” error.

Related issues
This is a pull that I created in the Godot.

I tried compiling and testing the four channel microphone on my laptop, and it turned out to be error free. This enables the successful use of multi-channel microphones in Godot.

I made the assumption that the microphone might have a potential configuration with odd channels (e.g., Left, Right, Center), although such configurations are uncommon (in some professional audio equipment). The goal was to ensure that the microphone is at least usable within Godot, regardless of the channel count. The WASAPI documentation itself doesn't explicitly specify how multi-channel microphones should be handled, so I aimed for a more general solution to accommodate various configurations.

Thank you for reviewing !

Support multi-channel microphone input by downmixing to stereo
- Enhanced the WASAPI audio driver to support microphones with any number of channels.
- This modification ensures compatibility with a broader range of multi-channel microphones, allowing for more versatile input handling in Godot.
Regarding “WASAPI: unsupported channel count in microphone!” error.
@SleeeepyZhou SleeeepyZhou changed the title Master WASAPI multi-channel microphone input Oct 2, 2024
@Spartan322
Copy link
Member

Spartan322 commented Oct 14, 2024

This needs to be squashed, aside from that, do you have people who we can speak to who can test the robustness of this? The more people we have to test, especially in some of the odd configurations, the better.

@SleeeepyZhou
Copy link
Author

This needs to be squash, aside from that, do you have people who we can speak to who can test the robustness of this? The more people we have to test, especially in some of the odd configurations, the better.

Oh yes, it seems to require three approvals to merge. In addition, this fix is for microphones with more than two channels (such as my laptop which has five channels). I allocated the extra channels, and if there is one left, I evenly distributed them. This fix runs well on my laptop.
You can view the pulls I previously initiated in the Godot repository.

@Spartan322
Copy link
Member

Yeah I just wanted to get as many testers I can speak on this as possible, other than that it just needs to be squashed down to one PR and I don't see a reason it wouldn't be merged quick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants