-
-
Notifications
You must be signed in to change notification settings - Fork 23.8k
WASAPI multi-channel microphone input #101673
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
base: master
Are you sure you want to change the base?
Conversation
SleeeepyZhou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After my investigation, most microphones on the market are dual channel (left and right). Some microphones also have multiple microphone channels for noise reduction, recording environmental sounds and eliminating noise. Or a professional multi-channel microphone for better spatial audio. However, there is basically no specific channel correspondence (based solely on the information I obtained from my investigation). Therefore, the data can only be averaged to obtain relatively reasonable results.
Calinou
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me on principle, but I don't have a microphone with more than 2 channels to test this.
Co-authored-by: Hugo Locurcio <[email protected]>
Co-authored-by: Hugo Locurcio <[email protected]>
It's almost as if we need an input channel overriding version of #103655 to make it possible to test. |
|
I'll try to ask on my mailing list if anyone knows the industry practices with non mono mics. Edited: I'll try to reply by the end of the week. |
|
Found this after writing my own solution. I built it on my device (where the 4 channel mic was making things not work at all) and it works. |
Would you like me to make you a multi-channel virtual audio input device? Otherwise I can send you a small DIY 4-channel microphone array prototype to test with real hardware. |
Support multi-channel microphone input by downmixing to stereo
I mistakenly modified the branch of the original PR #96947 , so I have recreated this PR.
Fix #82823
Fix #30313
Fix #99989
Issues #82823
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.
I apologize for the inconvenience caused by the multiple review requests. Due to my unfamiliarity with the process, I made several revisions which have led to some wasted time. I have now reviewed and confirmed that everything is correct.
Thank you for your understanding and patience.
Thank you for reviewing !