Skip to content

Conversation

@squarebananas
Copy link
Contributor

Fixes OpenAL default microphone selection.

The OpenAL.ALC.alcGetString method (also referred to in another library here https://learn.microsoft.com/en-us/dotnet/api/opentk.audio.openal.alcgetstringlist) can either give:

  • "the name of the specified capture device" (when given a pointer to an opened device), or
  • "a list of all available capture devices if no capture device is specified" (when given IntPtr.Zero)

Currently the initialized output device is used with this method, and this results in no microphone being captured. Switching to IntPtr.Zero resolves this as it provides the correct list used to populate the available Microphone list, which is then used to select a default Microphone.

@nkast nkast merged commit 14ab577 into kniEngine:main Jun 2, 2025
1 check passed
nkast pushed a commit that referenced this pull request Jun 3, 2025
Thanks @squarebananas for spotting this bug.

For the record, the list will contain a non-mic device but we can't do something about it.
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.

2 participants