Refactor, improve: use pathlib, allow audios other than wavs in resample

This commit is contained in:
litagin02
2024-03-15 11:10:23 +09:00
parent 5c1e791b9a
commit 867855ace9
2 changed files with 50 additions and 54 deletions

View File

@@ -129,14 +129,14 @@ def initialize(
def resample(model_name, normalize, trim, num_processes):
logger.info("Step 2: start resampling...")
dataset_path, _, _, _, _ = get_path(model_name)
in_dir = os.path.join(dataset_path, "raw")
out_dir = os.path.join(dataset_path, "wavs")
input_dir = os.path.join(dataset_path, "raw")
output_dir = os.path.join(dataset_path, "wavs")
cmd = [
"resample.py",
"--in_dir",
in_dir,
"--out_dir",
out_dir,
"-i",
input_dir,
"-o",
output_dir,
"--num_processes",
str(num_processes),
"--sr",