55from fairseq import checkpoint_utils
66import librosa ,torch ,parselmouth ,faiss ,time ,threading
77import torch .nn .functional as F
8-
98#import matplotlib.pyplot as plt
109from infer_pack .models import SynthesizerTrnMs256NSFsid , SynthesizerTrnMs256NSFsid_nono
11- from language import language_gui
10+ from webui_locale import I18nAuto
11+ i18n = I18nAuto ()
1212
1313device = torch .device ("cuda" if torch .cuda .is_available () else "cpu" )
1414
@@ -170,24 +170,24 @@ def launcher(self):
170170 sg .Frame (layout = [
171171 [sg .Text (i18n ("输入设备/Input Device" )),sg .Combo (input_devices ,key = 'sg_input_device' ,default_value = input_devices [sd .default .device [0 ]])],
172172 [sg .Text (i18n ("输出设备/Output Device" )),sg .Combo (output_devices ,key = 'sg_output_device' ,default_value = output_devices [sd .default .device [1 ]])]
173- ],title = i18n (' 音频设备(请使用同种类驱动)/Audio Devices' ))
173+ ],title = i18n (" 音频设备(请使用同种类驱动)/Audio Devices" ))
174174 ],
175175 [
176176 sg .Frame (layout = [
177- [sg .Text (i18n (' 响应阈值/Silence Threhold' )),sg .Slider (range = (- 60 ,0 ),key = 'threhold' ,resolution = 1 ,orientation = 'h' ,default_value = - 30 )],
177+ [sg .Text (i18n (" 响应阈值/Silence Threhold" )),sg .Slider (range = (- 60 ,0 ),key = 'threhold' ,resolution = 1 ,orientation = 'h' ,default_value = - 30 )],
178178 [sg .Text (i18n ("音调设置/Pitch Offset" )),sg .Slider (range = (- 24 ,24 ),key = 'pitch' ,resolution = 1 ,orientation = 'h' ,default_value = 12 )]
179179
180- ],title = i18n (' 常规设置/Common' )),
180+ ],title = i18n (" 常规设置/Common" )),
181181 sg .Frame (layout = [
182- [sg .Text (i18n (' 采样长度/Sample Length' )),sg .Slider (range = (0.1 ,3.0 ),key = 'block_time' ,resolution = 0.1 ,orientation = 'h' ,default_value = 1.0 )],
183- [sg .Text (i18n (' 淡入淡出长度/Crossfade Length' )),sg .Slider (range = (0.01 ,0.15 ),key = 'crossfade_length' ,resolution = 0.01 ,orientation = 'h' ,default_value = 0.08 )],
184- [sg .Text (i18n (' 额外推理时长/Extra Length' )),sg .Slider (range = (0.05 ,3.00 ),key = 'extra_time' ,resolution = 0.01 ,orientation = 'h' ,default_value = 0.05 )]
185- ],title = i18n (' 性能设置/Performance' ))
182+ [sg .Text (i18n (" 采样长度/Sample Length" )),sg .Slider (range = (0.1 ,3.0 ),key = 'block_time' ,resolution = 0.1 ,orientation = 'h' ,default_value = 1.0 )],
183+ [sg .Text (i18n (" 淡入淡出长度/Crossfade Length" )),sg .Slider (range = (0.01 ,0.15 ),key = 'crossfade_length' ,resolution = 0.01 ,orientation = 'h' ,default_value = 0.08 )],
184+ [sg .Text (i18n (" 额外推理时长/Extra Length" )),sg .Slider (range = (0.05 ,3.00 ),key = 'extra_time' ,resolution = 0.01 ,orientation = 'h' ,default_value = 0.05 )]
185+ ],title = i18n (" 性能设置/Performance" ))
186186 ],
187- [sg .Button (i18n (' 开始音频转换' ),key = 'start_vc' ),sg .Button (i18n (' 停止音频转换' ),key = 'stop_vc' )]
187+ [sg .Button (i18n (" 开始音频转换" ),key = 'start_vc' ),sg .Button (i18n (" 停止音频转换" ),key = 'stop_vc' )]
188188 ]
189189
190- self .window = sg .Window (' RVC - GUI' ,layout = layout )
190+ self .window = sg .Window (" RVC - GUI" ,layout = layout )
191191 self .event_handler ()
192192
193193 def event_handler (self ):
@@ -325,6 +325,4 @@ def set_devices(self,input_device,output_device):
325325 sd .default .device [0 ]= input_device_indices [input_devices .index (input_device )]
326326 sd .default .device [1 ]= output_device_indices [output_devices .index (output_device )]
327327 print ("input device:" + str (sd .default .device [0 ])+ ":" + str (input_device ))
328- print ("output device:" + str (sd .default .device [1 ])+ ":" + str (output_device ))
329- i18n = language_gui .I18nAuto ()
330- gui = GUI ()
328+ print ("output device:" + str (sd .default .device [1 ])+ ":" + str (output_device ))
0 commit comments