代码拉取完成,页面将自动刷新
import os
import shutil
from utils.file_io import file_r, file_w
if __name__ == '__main__':
sound_root_path = "wav"
transcript_root_path = "transcript"
transcript_text = file_r(transcript_root_path + "/transcript.txt")
transcript_text_new = ""
is_full_old_name = 1
count = 1
if not os.path.exists(sound_root_path+"/output_rename_by_txt/"):
os.mkdir(sound_root_path+"/output_rename_by_txt/")
for line in transcript_text.split("\n"):
if len(line) == 0:
continue
line_file_name = line.split(" ")[0]
line_file_txt = "".join(line.split(" ")[1:])
if is_full_old_name == 1:
line_file_name_new = line_file_name+"_"+line_file_txt
else:
line_file_name_new = line_file_txt
transcript_text_new = transcript_text_new + line_file_name_new + " " + line_file_txt + "\n"
shutil.copy(sound_root_path+"/output/"+line_file_name+".wav", sound_root_path+"/output_rename_by_txt/"+line_file_name_new+".wav")
count = count+1
file_w(transcript_root_path + "/transcript_rename_by_txt.txt", transcript_text_new, "a")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。