Spaces:
Running
Running
Arnab Das
commited on
Commit
·
381d1cb
1
Parent(s):
a509d27
Allow mp3 files.
Browse files
manipulate_model/utils.py
CHANGED
@@ -39,13 +39,11 @@ def load_audio(file_path, config):
|
|
39 |
|
40 |
audio = None
|
41 |
|
42 |
-
if file_path.endswith(".wav") or file_path.endswith(".flac"):
|
43 |
audio, sample_rate = torchaudio.load(file_path)
|
44 |
if sample_rate != config.data.sr:
|
45 |
print("requires resampling")
|
46 |
audio = torchaudio.functional.resample(audio, sample_rate, config.data.sr)
|
47 |
-
elif file_path.endswith(".mp3"):
|
48 |
-
pass
|
49 |
elif file_path.endswith(".mp4"):
|
50 |
#_, audio, _ = read_video(file_path)
|
51 |
pass
|
|
|
39 |
|
40 |
audio = None
|
41 |
|
42 |
+
if file_path.endswith(".wav") or file_path.endswith(".flac") or file_path.endswith(".mp3"):
|
43 |
audio, sample_rate = torchaudio.load(file_path)
|
44 |
if sample_rate != config.data.sr:
|
45 |
print("requires resampling")
|
46 |
audio = torchaudio.functional.resample(audio, sample_rate, config.data.sr)
|
|
|
|
|
47 |
elif file_path.endswith(".mp4"):
|
48 |
#_, audio, _ = read_video(file_path)
|
49 |
pass
|