Update prosody_preprocessor.py
Browse files- prosody_preprocessor.py +4 -3
prosody_preprocessor.py
CHANGED
|
@@ -97,6 +97,7 @@ class ProsodyPreprocessor(FeatureExtractionMixin):
|
|
| 97 |
def extract_features(self, audio):
|
| 98 |
"""Extract F0 and intensity features"""
|
| 99 |
print(f"audio", audio)
|
|
|
|
| 100 |
audio = torch.Tensor(audio)
|
| 101 |
|
| 102 |
if audio.dim() == 1:
|
|
@@ -105,9 +106,9 @@ class ProsodyPreprocessor(FeatureExtractionMixin):
|
|
| 105 |
f0 = f0[0, 0, :]
|
| 106 |
f0_interpolated = f0_interp[0, 0, :]
|
| 107 |
|
| 108 |
-
|
| 109 |
-
f0 = f0[
|
| 110 |
-
f0_interpolated = f0_interpolated[
|
| 111 |
|
| 112 |
sound = parselmouth.Sound(audio.numpy(), sampling_frequency=self.sampling_rate, start_time=0)
|
| 113 |
print(f"Sound duration: {sound.duration} seconds")
|
|
|
|
| 97 |
def extract_features(self, audio):
|
| 98 |
"""Extract F0 and intensity features"""
|
| 99 |
print(f"audio", audio)
|
| 100 |
+
print('Extracting features')
|
| 101 |
audio = torch.Tensor(audio)
|
| 102 |
|
| 103 |
if audio.dim() == 1:
|
|
|
|
| 106 |
f0 = f0[0, 0, :]
|
| 107 |
f0_interpolated = f0_interp[0, 0, :]
|
| 108 |
|
| 109 |
+
|
| 110 |
+
f0 = f0[6:]
|
| 111 |
+
f0_interpolated = f0_interpolated[6:]
|
| 112 |
|
| 113 |
sound = parselmouth.Sound(audio.numpy(), sampling_frequency=self.sampling_rate, start_time=0)
|
| 114 |
print(f"Sound duration: {sound.duration} seconds")
|