Spaces:
Runtime error
Runtime error
got .wav working, now accepting multiple files
Browse files
app.py
CHANGED
@@ -43,19 +43,22 @@ if __name__ == "__main__":
|
|
43 |
|
44 |
uploaded_file = st.file_uploader("Choose a file", type=[
|
45 |
".wav",
|
46 |
-
".mp3",
|
47 |
-
]
|
|
|
|
|
48 |
|
49 |
-
|
50 |
-
if uploaded_file is not None:
|
51 |
-
|
52 |
-
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
60 |
|
61 |
|
|
|
43 |
|
44 |
uploaded_file = st.file_uploader("Choose a file", type=[
|
45 |
".wav",
|
46 |
+
# ".mp3", # TODO: convert .mp3 to .wav and save
|
47 |
+
],
|
48 |
+
accept_multiple_files=True,
|
49 |
+
)
|
50 |
|
51 |
+
for uploaded_file in uploaded_files:
|
|
|
|
|
|
|
52 |
|
53 |
+
if uploaded_file is not None:
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
st.audio(uploaded_file, format='audio/wav')
|
58 |
+
|
59 |
+
wav_file = get_path_to_wav_format(uploaded_file)
|
60 |
+
st.write(wav_file)
|
61 |
+
result = model.recognize(wav_file, langcode)
|
62 |
+
st.write(result)
|
63 |
|
64 |
|