Add time_suffix option

This commit is contained in:
aka7774
2024-03-13 16:07:09 +09:00
parent cd02238b28
commit 3d36778e06
2 changed files with 22 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ def do_slice(
min_sec: float,
max_sec: float,
min_silence_dur_ms: int,
time_suffix: bool,
input_dir: str,
):
if model_name == "":
@@ -36,6 +37,8 @@ def do_slice(
"--min_silence_dur_ms",
str(min_silence_dur_ms),
]
if time_suffix:
cmd.append("--time_suffix")
if input_dir != "":
cmd += ["--input_dir", input_dir]
# onnxの警告が出るので無視する
@@ -140,6 +143,10 @@ with gr.Blocks(theme=GRADIO_THEME) as app:
step=100,
label="無音とみなして区切る最小の無音の長さms",
)
time_suffix = gr.Checkbox(
value=False,
label="WAVファイル名の末尾に元ファイルの時間範囲を付与する",
)
slice_button = gr.Button("スライスを実行")
result1 = gr.Textbox(label="結果")
with gr.Row():
@@ -174,7 +181,7 @@ with gr.Blocks(theme=GRADIO_THEME) as app:
result2 = gr.Textbox(label="結果")
slice_button.click(
do_slice,
inputs=[model_name, min_sec, max_sec, min_silence_dur_ms, input_dir],
inputs=[model_name, min_sec, max_sec, min_silence_dur_ms, time_suffix, input_dir],
outputs=[result1],
)
transcribe_button.click(