Open Gamemap opened 3 years ago
@Gamemap Please upload a minimal reproduction project to make this easier to troubleshoot.
I have uploaded it. You have to enable Stereo Mix on Windows or you can change the line 12 to `AudioServer.capture_set_device("Micophone"). (If you have an Microphon on your PC)
I can't be sure AudioServer.capture_set_device() works or not, because the minimal project is too simple, so I just uplaod the screenshot
When I run the exact same script, my output is this:
Maybe it is somhow only one Realtekdevice?
When I run the exact same script, my output is this:
Maybe it is somhow only one Realtekdevice?
I use Mac, so not sure about that
It is probably a Windows problem. (I use Windows 8.1)
AudioServer.device =AudioServer.get_device_list()[1]
does not work either. ( Speaker (Realtek High Definition Audio) )
If I run this script and use a AudioStreamPlayer with a AudioStreamMicrophone the Output prints Default
but the Microphone (also Stereo Mix) don't work. Without this code the microphone works.
AudioServer.capture_set_device("Stereo Mix (Realtek High Definition Audio)")
print(AudioServer.capture_get_device())
Edit: There is also this error:
E 0:00:02.473 audiodeviceinit: WASAPI: Initialize failed with error 0xffffffff8889000a.
<C++-Fehler> Condition "hr != ((HRESULT)0x00000000)" is true. Returned: ERRCANTOPEN
<C++-Quellcode>drivers/wasapi/audiodriverwasapi.cpp:299 @ audiodeviceinit()
I am on Windows 10 and setting the device as above does indeed not work. Godot 3.3.2 Stable.
AudioServer.capture_set_device(AudioServer.capture_get_device_list()[2])
Dosn't work on Windows 11 with Godot v4.0.alpha2.official [79077e6c1].
AudioServer.capture_set_device(AudioServer.capture_get_device_list()[1])
Not working with Godot v4.0.alpha10.official [4bbe7f0b9]
Tested on Windows 7 SP1, Godot_v3.5.1-stable_win64, Godot_v3.5-stable_win64, Godot_v3.4.4-stable_win64. Not working. I tried to set device from capture_get_device_list (I have 3 devices). The result of AudioServer.capture_get_device() is always "Default".
Also not working with Godot 4.0 Beta 1. Edit: ... and with Beta 3 neither.
With #69120, here is a new project to test this: beta17.zip
Update: It seems that the output device does actually update, but it won't print the new device name immediately after. Selecting a new output device and playing a sound (see project) shows that it is still being updated. No luck with the input device, still.
Do you have microphone access enabled in the Windows settings? This setting affects both Win32 and UWP applications.
Also make sure Let desktop apps access your microphone is enabled on that page.
I have the equivalent Windows 10 setting enabled, but Godot 4 does not come up on the list of apps, so that might be related.
Edit: Nevermind, giving Godot and a running project the input devices through audio settings does not work either. The console is printing the current input device using AudioServer.get_input_device()
.
Microphone input does not work on Godot 4 Beta 17 & RC1 due to #72892. I'll build from master on Windows 11 and see if that makes a difference.
Time flies. Turns out (at least my hunch is) Godot isn't initializing the microphone (even after enabling audio input in Project Settings). Checking the Windows microphone settings, the last time Godot asked for microphone use was in Godot 3 about a year ago on my machine. So for some reason, WASAPI might not be initializing now in Godot 4.0.
Time flies. Turns out (at least my hunch is) Godot isn't initializing the microphone (even after enabling audio input in Project Settings). Checking the Windows microphone settings, the last time Godot asked for microphone use was in Godot 3 about a year ago on my machine. So for some reason, WASAPI might not be initializing now in Godot 4.0.
Same problem here, did all of the above but WASAPI is not initializing. I got it to work in a Beta, but somehow the problem returned.
If I run Godot 4 first, no error, but as soon as I turn on another audio program (to get the input in) its starts spitting the errors:
W 0:00:28:0839 thread_func: WASAPI: Current output_device invalidated, closing output_device <C++ Source> drivers/wasapi/audio_driver_wasapi.cpp:794 @ thread_func()
Started working for me after disabling all other microphones and turning off "Exclusive Mode" on my default microphone.
Since this is not a necessary step to do in other games, I think it is still fair to consider this a bug.
Godot version:
Godot 3.2.3 64 Bit and Godot 3.2.4 RC3
OS/device including version:
Windows 8.1
Issue description:
AudioServer.capture_set_device("Stereo Mix")
don't work.print(AudioServer.capture_get_device_list())
Has as output:[Default, Stereo Mix (Realtek High Definition Audio), Microphone (Realtek High Definition Audio)]
ButAudioServer.capture_set_device("Stereo Mix")
(orAudioServer.capture_set_device("Stereo Mix (Realtek High Definition Audio)"))
has withprint(AudioServer.capture_get_device())
onlyDefault
as output. (It also won't work with Microphone.)Maybe the documentation should be improved, if I have understood something wrong. I haven't tested the AudioServer.device .
Steps to reproduce:
Minimal reproduction project:
AudioServer.zip (Enable Stereo Mix in Windows AudioSettings.)