File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import gradio as gr
2+ import sounddevice as sd
23import os
34import sys
45import time
2122 get_speakers_id ,
2223 create_folder_and_move_files ,
2324 refresh_embedders_folders ,
24- custom_embedder_root_relative ,
2525 model_root_relative ,
2626)
2727
@@ -472,6 +472,7 @@ def realtime_tab():
472472 value = get_safe_dropdown_value (
473473 saved_settings ["model_file" ], model_choices , default_weight
474474 ),
475+ allow_custom_value = True ,
475476 )
476477 index_choices = get_indexes ()
477478 index_file = gr .Dropdown (
@@ -483,6 +484,7 @@ def realtime_tab():
483484 match_index (default_weight ) if default_weight else None ,
484485 ),
485486 interactive = True ,
487+ allow_custom_value = True ,
486488 )
487489
488490 with gr .Row ():
@@ -701,6 +703,9 @@ def update_on_model_change(model_path):
701703 ), gr .update (choices = new_sids , value = 0 if new_sids else None )
702704
703705 def refresh_devices ():
706+ sd ._terminate ()
707+ sd ._initialize ()
708+
704709 input_choices , output_choices = get_audio_devices_formatted ()
705710 input_choices , output_choices = list (input_choices .keys ()), list (
706711 output_choices .keys ()
You can’t perform that action at this time.
0 commit comments