Zasha1 commited on
Commit
c5eed5a
·
verified ·
1 Parent(s): 0f82ede

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -119,9 +119,10 @@ def transcribe_audio(audio_bytes, sample_rate=16000):
119
 
120
  chunks = transcribe_with_chunks(wav_buffer.getvalue())
121
  if chunks:
 
122
  return chunks[-1][0]
123
  except Exception as e:
124
- print(f"Error transcribing audio: {e}")
125
  return None
126
 
127
  class AudioProcessor(AudioProcessorBase):
@@ -133,6 +134,7 @@ class AudioProcessor(AudioProcessorBase):
133
  audio_bytes = (audio_data * 32767).astype(np.int16).tobytes()
134
  text = transcribe_audio(audio_bytes)
135
  if text:
 
136
  self.transcription_queue.put(text)
137
  return frame
138
 
 
119
 
120
  chunks = transcribe_with_chunks(wav_buffer.getvalue())
121
  if chunks:
122
+ st.write(f"Transcribed chunks: {chunks}")
123
  return chunks[-1][0]
124
  except Exception as e:
125
+ st.error(f"Error transcribing audio: {e}")
126
  return None
127
 
128
  class AudioProcessor(AudioProcessorBase):
 
134
  audio_bytes = (audio_data * 32767).astype(np.int16).tobytes()
135
  text = transcribe_audio(audio_bytes)
136
  if text:
137
+ st.write(f"Transcribed text: {text}")
138
  self.transcription_queue.put(text)
139
  return frame
140