Spaces:
Running
Running
Mahiruoshi
commited on
Commit
•
a88d850
1
Parent(s):
112320c
Update app.py
Browse files
app.py
CHANGED
@@ -211,6 +211,7 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|
211 |
"""
|
212 |
|
213 |
for sentence in group:
|
|
|
214 |
print(sentence)
|
215 |
FakeSpeaker = sentence.split("|")[0]
|
216 |
print(FakeSpeaker)
|
@@ -232,6 +233,8 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
|
232 |
end_time = start_time + duration + silenceTime
|
233 |
ass_entries.append("Dialogue: 0,{},{},".format(seconds_to_ass_time(start_time), seconds_to_ass_time(end_time)) + "Default,,0,0,0,,{}".format(sentence.replace("|",":")))
|
234 |
start_time = end_time
|
|
|
|
|
235 |
|
236 |
wav_filename = os.path.join(outputPath, f'audiobook_part_{group_index}.wav')
|
237 |
ass_filename = os.path.join(outputPath, f'audiobook_part_{group_index}.ass')
|
@@ -385,7 +388,7 @@ if __name__ == "__main__":
|
|
385 |
)
|
386 |
with gr.Accordion(label="参数设定", open=False):
|
387 |
sdp_ratio = gr.Slider(
|
388 |
-
minimum=0, maximum=1, value=0.
|
389 |
)
|
390 |
noise_scale = gr.Slider(
|
391 |
minimum=0.1, maximum=2, value=0.6, step=0.01, label="感情调节"
|
@@ -439,8 +442,8 @@ if __name__ == "__main__":
|
|
439 |
inputFile = gr.UploadButton(label="txt文件输入")
|
440 |
raw_text = gr.TextArea(
|
441 |
label="文本输入",
|
442 |
-
info="
|
443 |
-
value="
|
444 |
)
|
445 |
groupSize = gr.Slider(
|
446 |
minimum=10, maximum=1000 if torch.cuda.is_available() else 50,value = 50, step=1, label="单个音频文件包含的最大字数"
|
@@ -461,7 +464,7 @@ if __name__ == "__main__":
|
|
461 |
)
|
462 |
with gr.Column():
|
463 |
sdp_ratio = gr.Slider(
|
464 |
-
minimum=0, maximum=1, value=0.
|
465 |
)
|
466 |
noise_scale = gr.Slider(
|
467 |
minimum=0.1, maximum=2, value=0.6, step=0.01, label="感情调节"
|
|
|
211 |
"""
|
212 |
|
213 |
for sentence in group:
|
214 |
+
try:
|
215 |
print(sentence)
|
216 |
FakeSpeaker = sentence.split("|")[0]
|
217 |
print(FakeSpeaker)
|
|
|
233 |
end_time = start_time + duration + silenceTime
|
234 |
ass_entries.append("Dialogue: 0,{},{},".format(seconds_to_ass_time(start_time), seconds_to_ass_time(end_time)) + "Default,,0,0,0,,{}".format(sentence.replace("|",":")))
|
235 |
start_time = end_time
|
236 |
+
except:
|
237 |
+
pass
|
238 |
|
239 |
wav_filename = os.path.join(outputPath, f'audiobook_part_{group_index}.wav')
|
240 |
ass_filename = os.path.join(outputPath, f'audiobook_part_{group_index}.ass')
|
|
|
388 |
)
|
389 |
with gr.Accordion(label="参数设定", open=False):
|
390 |
sdp_ratio = gr.Slider(
|
391 |
+
minimum=0, maximum=1, value=0.5, step=0.01, label="SDP/DP混合比"
|
392 |
)
|
393 |
noise_scale = gr.Slider(
|
394 |
minimum=0.1, maximum=2, value=0.6, step=0.01, label="感情调节"
|
|
|
442 |
inputFile = gr.UploadButton(label="txt文件输入")
|
443 |
raw_text = gr.TextArea(
|
444 |
label="文本输入",
|
445 |
+
info="输入纯日语",
|
446 |
+
value="つくし|なんではるひかげやったの?!!",
|
447 |
)
|
448 |
groupSize = gr.Slider(
|
449 |
minimum=10, maximum=1000 if torch.cuda.is_available() else 50,value = 50, step=1, label="单个音频文件包含的最大字数"
|
|
|
464 |
)
|
465 |
with gr.Column():
|
466 |
sdp_ratio = gr.Slider(
|
467 |
+
minimum=0, maximum=1, value=0.5, step=0.01, label="SDP/DP混合比"
|
468 |
)
|
469 |
noise_scale = gr.Slider(
|
470 |
minimum=0.1, maximum=2, value=0.6, step=0.01, label="感情调节"
|