sss2000 commited on
Commit
5438906
1 Parent(s): 954468c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -20,14 +20,12 @@ def translation(txt):
20
 
21
  # Main function
22
  def main():
23
- uploaded_file = st.file_uploader("Select an audio file")
24
 
 
 
25
  if uploaded_file is not None:
26
- bytes_data = uploaded_file.getvalue()
27
- with open(uploaded_file.name, "wb") as file:
28
- file.write(bytes_data)
29
-
30
- st.image(uploaded_file, caption="Uploaded Audio", use_column_width=True)
31
 
32
  # Stage 1: Audio to Text
33
  st.text('Processing audio2txt...')
 
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
+ audio_data = uploaded_file.read()
28
+ st.audio(audio_data, format='audio/mp3/m4a')
 
 
 
29
 
30
  # Stage 1: Audio to Text
31
  st.text('Processing audio2txt...')