mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Access microphone buffer from AudioServer and prevent microphone double starts
This commit is contained in:
parent
7ed0b61676
commit
3e8bf3ba91
7 changed files with 136 additions and 23 deletions
|
|
@ -555,6 +555,8 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
|
|||
}
|
||||
|
||||
// User selected a new input device, finish the current one so we'll init the new input device
|
||||
// (If `AudioServer.set_input_device()` did not set the value when the microphone was running,
|
||||
// this section with its problematic error handling could be deleted.)
|
||||
if (ad->input_device_name != ad->new_input_device) {
|
||||
ad->input_device_name = ad->new_input_device;
|
||||
ad->finish_input_device();
|
||||
|
|
@ -691,6 +693,10 @@ void AudioDriverPulseAudio::finish() {
|
|||
}
|
||||
|
||||
Error AudioDriverPulseAudio::init_input_device() {
|
||||
if (pa_rec_str) {
|
||||
return ERR_ALREADY_IN_USE;
|
||||
}
|
||||
|
||||
// If there is a specified input device, check that it is really present
|
||||
if (input_device_name != "Default") {
|
||||
PackedStringArray list = get_input_device_list();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue