Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,12 +15,12 @@ def get_path_to_wav_format(uploaded_file):
|
|
15 |
|
16 |
if ".wav" in uploaded_file.name:
|
17 |
return Path(uploaded_file.name)
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
|
26 |
def get_langcode_for_allosaurus(input_code):
|
|
|
15 |
|
16 |
if ".wav" in uploaded_file.name:
|
17 |
return Path(uploaded_file.name)
|
18 |
+
if ".mp3" in uploaded_file.name:
|
19 |
+
new_desired_path = actual_file_path.with_suffix(".wav")
|
20 |
+
waveform, sample_rate = torchaudio.load(actual_file_path)
|
21 |
+
st.info(waveform, sample_rate)
|
22 |
+
torchaudio.save(new_desired_path, waveform, sample_rate)
|
23 |
+
return new_desired_path
|
24 |
|
25 |
|
26 |
def get_langcode_for_allosaurus(input_code):
|