@@ -41,12 +41,15 @@ def main():
41
41
# Define download URLs
42
42
train_url = "http://www.openslr.org/resources/60/train-clean-100.tar.gz"
43
43
val_url = "http://www.openslr.org/resources/60/dev-clean.tar.gz"
44
+ test_url = "http://www.openslr.org/resources/60/test-clean.tar.gz"
44
45
45
46
# Define target directories and extraction subdirectories
46
47
train_dir = "./data/train"
47
48
val_dir = "./data/infer"
49
+ test_dir = "./data/infer"
48
50
train_extraction_subdir = os .path .join (train_dir , "LibriTTS" , "train-clean-100" )
49
51
val_extraction_subdir = os .path .join (val_dir , "LibriTTS" , "dev-clean" )
52
+ test_extraction_subdir = os .path .join (test_dir , "LibriTTS" , "test-clean" )
50
53
51
54
# Skip processing if the train or infer directory already exists
52
55
if os .path .exists (train_extraction_subdir ) and os .listdir (train_extraction_subdir ):
@@ -63,6 +66,13 @@ def main():
63
66
download_and_extract (val_url , val_dir )
64
67
generate_filelist (val_extraction_subdir , os .path .join (val_dir , "libritts_val" ))
65
68
69
+ if os .path .exists (test_extraction_subdir ) and os .listdir (test_extraction_subdir ):
70
+ print (f"{ test_extraction_subdir } already exists, skipping test data preparation." )
71
+ else :
72
+ print (f"Checking test data in { test_extraction_subdir } ..." )
73
+ download_and_extract (test_url , test_dir )
74
+ generate_filelist (test_extraction_subdir , os .path .join (test_dir , "libritts_testclean" ))
75
+
66
76
print ("Dataset preparation complete." )
67
77
68
78
if __name__ == "__main__" :
@@ -84,10 +94,7 @@ def main():
84
94
│ └── infer/
85
95
│ ├── LibriTTS/
86
96
│ │ └── dev-clean/
87
- │ │ ├── <speaker_id>/
88
- │ │ │ ├── <chapter_id>/
89
- │ │ │ │ ├── <audio_files>.wav
90
- │ │ │ │ └── ...
91
- │ │ └── ...
92
- │ └── libritts_val # File list generated here
97
+ │ | └── test-clean/
98
+ │ └── libritts_val
99
+ | └── libritts_testclean
93
100
"""
0 commit comments