Spaces:
Sleeping
Sleeping
try fixing cant find file
Browse files
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 |
-
|
70 |
-
|
71 |
-
)
|
|
|
72 |
|
73 |
# Transcribe the audio file
|
74 |
-
transcript_text = transcribe_audio(
|
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")
|