Spaces:
Sleeping
Sleeping
bug fix
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ from streamlit_webrtc import webrtc_streamer, WebRtcMode, RTCConfiguration
|
|
10 |
import av
|
11 |
import queue
|
12 |
|
|
|
13 |
# Define the models
|
14 |
MODELS = {
|
15 |
"Whisper (English)": "openai/whisper-small.en",
|
@@ -112,10 +113,11 @@ elif audio_option == 'Upload Audio':
|
|
112 |
audio_file = st.file_uploader("Upload audio file (WAV format)", type=['wav'])
|
113 |
|
114 |
if audio_file:
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
|
|
119 |
|
120 |
audio_data, sr = librosa.load(tmp_file_path, sr=None)
|
121 |
|
|
|
10 |
import av
|
11 |
import queue
|
12 |
|
13 |
+
|
14 |
# Define the models
|
15 |
MODELS = {
|
16 |
"Whisper (English)": "openai/whisper-small.en",
|
|
|
113 |
audio_file = st.file_uploader("Upload audio file (WAV format)", type=['wav'])
|
114 |
|
115 |
if audio_file:
|
116 |
+
|
117 |
+
# When writing the audio data, specify the format explicitly
|
118 |
+
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp_file:
|
119 |
+
sf.write(tmp_file.name, audio_data, sr, format='WAV')
|
120 |
+
tmp_file_path = tmp_file.name
|
121 |
|
122 |
audio_data, sr = librosa.load(tmp_file_path, sr=None)
|
123 |
|