Lguyogiro commited on
Commit
ef42c65
·
1 Parent(s): 5a57f1f

try fixing cant find file

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -60,18 +60,19 @@ def main():
60
  audio_file = st.file_uploader("Upload Audio", type=["wav"])
61
  if audio_file:
62
  file_extension = audio_file.type.split('/')[1]
63
- save_audio_file(audio_file.read(), file_extension)
64
 
65
  # Transcribe button action
66
  if st.button("Transcribe"):
67
  # Find the newest audio file
68
- audio_file_path = max(
69
- [f for f in os.listdir(".") if f.startswith("audio")],
70
- key=os.path.getctime,
71
- )
 
72
 
73
  # Transcribe the audio file
74
- transcript_text = transcribe_audio(audio_file_path)
75
 
76
  # Display the transcript
77
  st.header("Transcript")
 
60
  audio_file = st.file_uploader("Upload Audio", type=["wav"])
61
  if audio_file:
62
  file_extension = audio_file.type.split('/')[1]
63
+ fname = save_audio_file(audio_file.read(), file_extension)
64
 
65
  # Transcribe button action
66
  if st.button("Transcribe"):
67
  # Find the newest audio file
68
+ #audio_file_path = max(
69
+ # [f for f in os.listdir(".") if f.startswith("audio")],
70
+ # key=os.path.getctime,
71
+ #)
72
+
73
 
74
  # Transcribe the audio file
75
+ transcript_text = transcribe_audio(fname)
76
 
77
  # Display the transcript
78
  st.header("Transcript")