-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Microphone doesnt record on MacOS in Godot 3.5 #64583
Comments
Some additional info:
The project setting should override whatever was set using Audio MIDI Setup, like Apple does with its Logic Pro:
We should probably take the Godot setting, try to find the closest available sample rate, and create the audio unit with that. (And perhaps produce a warning about any mismatches.) |
Related: there was Fix for |
With the influx of things being made in Godot, this would be good to fix soon. But in a way where the sampling rate used in Godot can be whatever it needs instead of trying to force external devices to adapt to Godot. |
Hey y'all! Happy Hacktoberfest! Taking some notes from LosslessSwitcher, we have to tell macOS that we have a preferred sampling rate. I've implemented this by using
Unfortunately, it's not perfect. When connecting my AirPods (which can't provide 44.1kHz, only 24kHz) it will give a new error! Since it's a project-level setting, should we provide settings for "preferred" sampling rates, and then have it default to the closest possible? Or should we just provide an error to the user, so they can figure it out? |
Keep in mind that there are many common microphones where the sampling rate cannot be changed to 44,100, so the best solution would be to adapt Godot to the sampling rate rather than the other way around. |
Sure. Should I go the route of putting a note in the warnings section when there is a mismatch? And also, does Godot already have a method for dynamically changing the mix rate (from GDScript, so the user can manage it explicitly?) |
Not that I know of, especially for input audio devices. That said, changing output audio device sample rate is also not ideal. Apps shouldn't do this on their own as it can reduce audio quality significantly. If you have your microphone set above 48 kHz (which may be the case with some professional setups), your output audio device may not be able to match it either. The better solution is to resample the input in real-time (using linear or preferably cubic resampling), so that any input sample rate works with any output sample rate. This will add a bit of latency and CPU cost, but it's worth the usability and quality upgrade. |
Sure, I'll look into it. |
I am getting this same error in Godot 4.2 on my MacOS, Ventura 13.6.1 Downloaded audio recording demo here. Upgraded to Godot 4.2. Ran the project, errors. Changing the sample rate in the demo app does not resolve the problem, I must change it in the audio midi application. Is there any way I can help with this? I feel like this is a pretty big deal. I need audio recording for things in my game (voice chat, talking to an AI, etc), and not having it just a be a plug and play thing is gonna slow me down quite a bit. |
Still fighting with this issue in 4.2. I've been digging through the docs for a way to read the sample rate of an input source, but AudioServer only provides the string names with no metadata. It seems like we should ideally be able to just var mic = AudioServer.get_input_device_list()[0] # Pick from a dropdown menu, yadda yadda
AudioServer.set_mix_rate(mic.mix_rate) |
Godot version
3.5.stable
System information
MacOS Monterey, MacBook Pro 16inch, 16GB RAM, M1 Pro
Issue description
This issue is basically to reopen this issue - #35445
As its still reproducable in MacOS in Godot 3.5
As suggested in the above issue thread. I had to change the input rate in "Audio MIDI Setup" app to 44100Mhz to match with that of Godot in macos for it to work.
Reason why this workaround is not enough? End users might not know this when the game is shipped.
Steps to reproduce
Try running the reproducable project below. When your mac os audio input is not matching 41100mhz which by default its not and you will get the "AudioUnitRender error -10863" error
Minimal reproduction project
Here is a simple barebones reproducable project
https://github.com/vickylance/godot_audio_record_test
The text was updated successfully, but these errors were encountered: