Skip to content

Commit

Permalink
完成导出英文和数字功能
Browse files Browse the repository at this point in the history
  • Loading branch information
kslz committed Mar 14, 2023
1 parent c138bad commit ae5f64e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ui/mygui.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def __init__(self, parent, dataset_id):
self.ui.pushButton_next.clicked.connect(self.output_info)
self.ui.pushButton_read_preinstall.clicked.connect(self.use_preinstall)
self.ui.pushButton_back.clicked.connect(self.close)
self.ui.comboBox_geshi.currentIndexChanged.connect(self.auto_skip_change_enable)

def add_info(self):
"""
Expand All @@ -152,15 +153,25 @@ def add_info(self):
self.ui.comboBox_preinstall.addItem(f"VITS", GeshiStr.vits)
self.ui.comboBox_preinstall.setCurrentText(GeshiStr.vits)
self.use_preinstall()
self.auto_skip_change_enable()
result_list = get_speakers(self.dataset_id)
for line in result_list:
if line[1] == "shibie_spk":
text = f"{line[0]}-已识别"
else:
text = f"{line[0]}-未识别"
self.ui.comboBox_speaker.addItem(text, line)
# self.ui.checkBox_auto_skip.setEnabled(False)

def auto_skip_change_enable(self):
self.ui.checkBox_auto_skip.setEnabled(True)
self.ui.checkBox_auto_skip.setChecked(False)
now_geshi = self.ui.comboBox_geshi.currentData()
if now_geshi == GeshiStr.aishell3:
self.ui.checkBox_auto_skip.setChecked(True)
self.ui.checkBox_auto_skip.setEnabled(False)


def use_preinstall(self):
pre_name = self.ui.comboBox_preinstall.currentText()
if pre_name == GeshiStr.vits:
Expand Down
2 changes: 1 addition & 1 deletion utils/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def output_wav_file(wav_path, start_time, end_time, new_path, sample_rate, chann
if raw_channels > channels == 1:
normalization += 3
result = result.filter("loudnorm", I=normalization, TP=-1, LRA=11, linear="true")
result.output(new_path, format='wav', ac=channels, ar=sample_rate, acodec=codec).run_async(quiet=True)
result.output(new_path, format='wav', ac=channels, ar=sample_rate, acodec=codec).run_async(quiet=True)

# 从长音频文件中提取指定时间段的音频并先转为单声道音频,再进行归一化
# 注意:如果直接将双声道音频转换为单声道,并进行归一化,会导致单声道音频的输出结果偏低(相当于降低了3)
Expand Down

0 comments on commit ae5f64e

Please sign in to comment.