mirror of
https://github.com/litruv/PNGTuber-Plus.git
synced 2026-07-24 02:26:02 +10:00
Integrate microphone improvements from k0ffinz repository
- Add experimental microphone loudness detection feature - Remove microphone restart interval for better stability - Improve microphone initialization and error handling - Fix audio delay issues by setting channel_disable_time=0.0 - Update settings UI to include experimental mic loudness toggle - Add credits to k0ffinz/Ralsi for microphone improvements These changes improve audio responsiveness and fix various microphone-related issues including WASAPI errors and growing audio delay problems.
This commit is contained in:
@@ -7,17 +7,11 @@ func _ready():
|
||||
|
||||
|
||||
func _on_button_pressed():
|
||||
|
||||
if !get_parent().get_parent().get_parent().visible:
|
||||
return
|
||||
|
||||
AudioServer.input_device = micName
|
||||
Global.deleteAllMics()
|
||||
Global.currentMicrophone = null
|
||||
|
||||
Global.createMicrophone()
|
||||
get_parent().get_parent().get_parent().visible = false
|
||||
|
||||
await get_tree().create_timer(1.0).timeout
|
||||
Global.createMicrophone()
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ func setvalues():
|
||||
label.text = "costume " + str(tag) + " key: \"" + Global.main.costumeKeys[tag-1] + "\""
|
||||
tag += 1
|
||||
|
||||
$experimentalMicLoudness/checkmark.button_pressed = Global.experimentalMicLoudness
|
||||
|
||||
func _on_color_picker_button_color_changed(color):
|
||||
get_viewport().transparent_bg = false
|
||||
RenderingServer.set_default_clear_color(color)
|
||||
@@ -206,6 +208,12 @@ func _on_stream_deck_check_toggled(button_pressed):
|
||||
get_node("/root/ElgatoStreamDeck").refresh_connection()
|
||||
Global.pushUpdate("StreamDeck integration " + ("enabled" if button_pressed else "disabled") + ".")
|
||||
|
||||
## Handle experimental microphone loudness toggle
|
||||
## @param checked: bool - Whether experimental mic loudness should be enabled
|
||||
func _on_experimental_mic_loudness_toggle(checked):
|
||||
Global.experimentalMicLoudness = checked
|
||||
Saving.settings["experimentalMicLoudness"] = checked
|
||||
|
||||
|
||||
func _process(delta):
|
||||
var g = to_local(get_global_mouse_position())
|
||||
|
||||
Reference in New Issue
Block a user