Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,10 @@ def get_path_to_wav_format(uploaded_file):
|
|
8 |
st.write(dir(uploaded_file))
|
9 |
st.write(type(uploaded_file))
|
10 |
st.write(uploaded_file)
|
|
|
|
|
11 |
if ".wav" in uploaded_file.name:
|
|
|
12 |
return Path(uploaded_file.name)
|
13 |
# TODO: .mp3 conversion
|
14 |
|
@@ -45,13 +48,11 @@ if __name__ == "__main__":
|
|
45 |
|
46 |
|
47 |
|
48 |
-
# audio_bytes = audio_file.read()
|
49 |
st.audio(uploaded_file, format='audio/wav')
|
50 |
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
st.write(result)
|
56 |
|
57 |
|
|
|
8 |
st.write(dir(uploaded_file))
|
9 |
st.write(type(uploaded_file))
|
10 |
st.write(uploaded_file)
|
11 |
+
|
12 |
+
|
13 |
if ".wav" in uploaded_file.name:
|
14 |
+
actual_file = uploaded_file.write(uploaded_file.name)
|
15 |
return Path(uploaded_file.name)
|
16 |
# TODO: .mp3 conversion
|
17 |
|
|
|
48 |
|
49 |
|
50 |
|
|
|
51 |
st.audio(uploaded_file, format='audio/wav')
|
52 |
|
53 |
+
wav_file = get_path_to_wav_format(uploaded_file)
|
54 |
+
st.write(wav_file)
|
55 |
+
result = model.recognize(wav_file, langcode)
|
56 |
+
st.write(result)
|
|
|
57 |
|
58 |
|