Update app.py
Browse files
app.py
CHANGED
@@ -117,6 +117,7 @@ def transcribe_audio(audio_bytes, sample_rate=16000):
|
|
117 |
wf.setframerate(sample_rate)
|
118 |
wf.writeframes(audio_bytes)
|
119 |
|
|
|
120 |
chunks = transcribe_with_chunks(wav_buffer.getvalue())
|
121 |
if chunks:
|
122 |
st.write(f"Transcribed chunks: {chunks}")
|
@@ -131,6 +132,7 @@ class AudioProcessor(AudioProcessorBase):
|
|
131 |
|
132 |
def recv(self, frame):
|
133 |
audio_data = frame.to_ndarray()
|
|
|
134 |
audio_bytes = (audio_data * 32767).astype(np.int16).tobytes()
|
135 |
text = transcribe_audio(audio_bytes)
|
136 |
if text:
|
|
|
117 |
wf.setframerate(sample_rate)
|
118 |
wf.writeframes(audio_bytes)
|
119 |
|
120 |
+
st.write("Audio saved, attempting transcription...")
|
121 |
chunks = transcribe_with_chunks(wav_buffer.getvalue())
|
122 |
if chunks:
|
123 |
st.write(f"Transcribed chunks: {chunks}")
|
|
|
132 |
|
133 |
def recv(self, frame):
|
134 |
audio_data = frame.to_ndarray()
|
135 |
+
st.write(f"Received audio frame: {audio_data.shape}")
|
136 |
audio_bytes = (audio_data * 32767).astype(np.int16).tobytes()
|
137 |
text = transcribe_audio(audio_bytes)
|
138 |
if text:
|