From a92b0cabff939fc297c601f8ffd5c5a7d0be1623 Mon Sep 17 00:00:00 2001 From: litagin02 Date: Sun, 26 May 2024 08:22:39 +0900 Subject: [PATCH] Improve: slice.py preserves subdir structure --- slice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slice.py b/slice.py index b3d013b..bfcb916 100644 --- a/slice.py +++ b/slice.py @@ -197,11 +197,12 @@ if __name__ == "__main__": q.task_done() break try: + rel_path = file.relative_to(input_dir) time_sec, count = split_wav( vad_model=vad_model, utils=utils, audio_file=file, - target_dir=output_dir, + target_dir=output_dir / rel_path.parent, min_sec=min_sec, max_sec=max_sec, min_silence_dur_ms=min_silence_dur_ms,