Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -173,10 +173,10 @@ with right:
|
|
| 173 |
|
| 174 |
uploaded_file = st.file_uploader("Or upload an audio file", type=["mp3", "wav", "flac", "aac"])
|
| 175 |
if st.button("Transcribe"):
|
| 176 |
-
if audio:
|
| 177 |
st.success("Recording detected. Transcribing your recording...")
|
| 178 |
with open("temp_recording.wav", "wb") as f:
|
| 179 |
-
f.write(audio)
|
| 180 |
with st.spinner("Transcribing..."):
|
| 181 |
transcription = transcribe("temp_recording.wav")
|
| 182 |
st.text_area("Transcription", transcription, height=200)
|
|
|
|
| 173 |
|
| 174 |
uploaded_file = st.file_uploader("Or upload an audio file", type=["mp3", "wav", "flac", "aac"])
|
| 175 |
if st.button("Transcribe"):
|
| 176 |
+
if audio and "bytes" in audio:
|
| 177 |
st.success("Recording detected. Transcribing your recording...")
|
| 178 |
with open("temp_recording.wav", "wb") as f:
|
| 179 |
+
f.write(audio["bytes"])
|
| 180 |
with st.spinner("Transcribing..."):
|
| 181 |
transcription = transcribe("temp_recording.wav")
|
| 182 |
st.text_area("Transcription", transcription, height=200)
|