Update rir-noise.py
Browse files- rir-noise.py +9 -9
rir-noise.py
CHANGED
|
@@ -33,7 +33,7 @@ class RIRNoise(datasets.GeneratorBasedBuilder):
|
|
| 33 |
{
|
| 34 |
"file": datasets.Value("string"),
|
| 35 |
"audio": datasets.Audio(sampling_rate=SAMPLE_RATE),
|
| 36 |
-
|
| 37 |
}
|
| 38 |
),
|
| 39 |
name="rir-noise",
|
|
@@ -81,17 +81,17 @@ class RIRNoise(datasets.GeneratorBasedBuilder):
|
|
| 81 |
_walker = [fileid for fileid in _walker]
|
| 82 |
|
| 83 |
for guid, audio_path in enumerate(_walker):
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
yield {
|
| 91 |
"id": str(guid),
|
| 92 |
"file": audio_path,
|
| 93 |
"audio": audio_path,
|
| 94 |
-
|
| 95 |
}
|
| 96 |
|
| 97 |
|
|
|
|
| 33 |
{
|
| 34 |
"file": datasets.Value("string"),
|
| 35 |
"audio": datasets.Audio(sampling_rate=SAMPLE_RATE),
|
| 36 |
+
"label": datasets.ClassLabel(names=_AUDIO_TYPES),
|
| 37 |
}
|
| 38 |
),
|
| 39 |
name="rir-noise",
|
|
|
|
| 81 |
_walker = [fileid for fileid in _walker]
|
| 82 |
|
| 83 |
for guid, audio_path in enumerate(_walker):
|
| 84 |
+
if 'pointsource_noises' in audio_path:
|
| 85 |
+
label = 'pointsource_noises'
|
| 86 |
+
elif 'real_rirs_isotropic_noises' in audio_path:
|
| 87 |
+
label = 'real_rirs_isotropic_noises'
|
| 88 |
+
elif 'simulated_rirs' in audio_path:
|
| 89 |
+
label = 'simulated_rirs'
|
| 90 |
+
yield guid, {
|
| 91 |
"id": str(guid),
|
| 92 |
"file": audio_path,
|
| 93 |
"audio": audio_path,
|
| 94 |
+
"label": label,
|
| 95 |
}
|
| 96 |
|
| 97 |
|