Update custom_interface_app.py
Browse files- custom_interface_app.py +1 -1
custom_interface_app.py
CHANGED
@@ -93,8 +93,8 @@ class ASR(Pretrained):
|
|
93 |
sr = 16000
|
94 |
max_segment_length = 30
|
95 |
|
96 |
-
# waveform, sr = librosa.load(file, sr=sr)
|
97 |
waveform, file_sr = torchaudio.load(file)
|
|
|
98 |
# resample if not 16kHz
|
99 |
if file_sr != sr:
|
100 |
waveform = torchaudio.transforms.Resample(file_sr, sr)(waveform)
|
|
|
93 |
sr = 16000
|
94 |
max_segment_length = 30
|
95 |
|
|
|
96 |
waveform, file_sr = torchaudio.load(file)
|
97 |
+
waveform = waveform.mean(dim=0, keepdim=True) # convert to mono
|
98 |
# resample if not 16kHz
|
99 |
if file_sr != sr:
|
100 |
waveform = torchaudio.transforms.Resample(file_sr, sr)(waveform)
|