Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,16 +20,15 @@ def translation(txt):
|
|
20 |
|
21 |
# Main function
|
22 |
def main():
|
23 |
-
|
24 |
uploaded_file = st.file_uploader("Select an audio file", type=["mp3", "wav","m4a"])
|
25 |
-
|
26 |
if uploaded_file is not None:
|
27 |
-
|
28 |
-
|
29 |
|
30 |
# Stage 1: Audio to Text
|
31 |
st.text('Processing audio2txt...')
|
32 |
-
txt = audio2txt(
|
33 |
st.write(txt)
|
34 |
|
35 |
# Stage 2: Text to Translation
|
|
|
20 |
|
21 |
# Main function
|
22 |
def main():
|
|
|
23 |
uploaded_file = st.file_uploader("Select an audio file", type=["mp3", "wav","m4a"])
|
24 |
+
|
25 |
if uploaded_file is not None:
|
26 |
+
audio_data = uploaded_file.read()
|
27 |
+
st.audio(audio_data, format='audio/mp3/m4a')
|
28 |
|
29 |
# Stage 1: Audio to Text
|
30 |
st.text('Processing audio2txt...')
|
31 |
+
txt = audio2txt(audio_data)
|
32 |
st.write(txt)
|
33 |
|
34 |
# Stage 2: Text to Translation
|