@@ -284,8 +284,13 @@ def refresh_embedders_folders():
284284
285285
286286def save_realtime_settings (
287- input_device , output_device , monitor_device , model_file , index_file ,
288- asio_enabled = None , audio_sample_rate = None ,
287+ input_device ,
288+ output_device ,
289+ monitor_device ,
290+ model_file ,
291+ index_file ,
292+ asio_enabled = None ,
293+ audio_sample_rate = None ,
289294):
290295 """Save realtime settings to config.json"""
291296 try :
@@ -349,7 +354,9 @@ def load_realtime_settings():
349354 "model_file" : realtime_config .get ("model_file" , "" ),
350355 "index_file" : realtime_config .get ("index_file" , "" ),
351356 "asio_enabled" : realtime_config .get ("asio_enabled" , False ),
352- "audio_sample_rate" : realtime_config .get ("audio_sample_rate" , 48000 ),
357+ "audio_sample_rate" : realtime_config .get (
358+ "audio_sample_rate" , 48000
359+ ),
353360 }
354361 except Exception as e :
355362 print (f"Error loading realtime settings: { e } " )
@@ -532,7 +539,9 @@ def start_realtime(
532539 _rt_cfg = load_realtime_settings ()
533540 asio_enabled = _rt_cfg ["asio_enabled" ]
534541 audio_sample_rate = _rt_cfg ["audio_sample_rate" ]
535- audio_sample_rate = resolve_sample_rate (input_device_id , asio_enabled , audio_sample_rate )
542+ audio_sample_rate = resolve_sample_rate (
543+ input_device_id , asio_enabled , audio_sample_rate
544+ )
536545 read_chunk_size = int (chunk_size * audio_sample_rate / 1000 / 128 )
537546
538547 callbacks_kwargs = {
@@ -643,7 +652,9 @@ def start_realtime(
643652 else 0
644653 )
645654 if warmup_remaining > 0 :
646- yield i18n ("Warming up... ({} blocks remaining)" ).format (warmup_remaining ), interactive_false , interactive_true
655+ yield i18n ("Warming up... ({} blocks remaining)" ).format (
656+ warmup_remaining
657+ ), interactive_false , interactive_true
647658 else :
648659 yield f"Latency: { audio_manager .latency :.2f} ms | Volume: { audio_manager .volume :.2f} dB" , interactive_false , interactive_true
649660
@@ -845,11 +856,13 @@ def soundfile_record_audio(
845856 now_dir , "assets" , "audios" , "record_audio.wav"
846857 )
847858
848- callbacks .vc .send_config ({
849- "record_start" : True ,
850- "record_audio_path" : record_audio_path ,
851- "export_format" : export_format ,
852- })
859+ callbacks .vc .send_config (
860+ {
861+ "record_start" : True ,
862+ "record_audio_path" : record_audio_path ,
863+ "export_format" : export_format ,
864+ }
865+ )
853866
854867 return "Stop" , None
855868 else :
@@ -1080,7 +1093,6 @@ def realtime_tab():
10801093 interactive = True ,
10811094 )
10821095
1083-
10841096 with gr .TabItem (i18n ("Model Settings" )):
10851097 with gr .Row ():
10861098 model_choices = (
0 commit comments