pratikshahp commited on
Commit
6488f67
·
verified ·
1 Parent(s): 86b41e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -3,7 +3,7 @@ import torchaudio
3
  from torchaudio.transforms import Resample
4
  from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
5
  import streamlit as st
6
- from streamlit_audio_recorder import st_audio_recorder
7
 
8
  def preprocess_audio(audio_bytes, sample_rate=16000):
9
  # Load audio and convert to mono if necessary
@@ -37,7 +37,7 @@ def transcribe_audio(audio_bytes):
37
  st.title("Audio to Text Transcription with Recording")
38
 
39
  # Use the st_audio_recorder widget to record audio
40
- audio_bytes = st_audio_recorder(sample_rate=16000, codec="wav", show_playback_controls=True)
41
 
42
  # Display the recorded audio
43
  if audio_bytes:
 
3
  from torchaudio.transforms import Resample
4
  from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
5
  import streamlit as st
6
+ from audio_recorder_streamlit import audio_recorder
7
 
8
  def preprocess_audio(audio_bytes, sample_rate=16000):
9
  # Load audio and convert to mono if necessary
 
37
  st.title("Audio to Text Transcription with Recording")
38
 
39
  # Use the st_audio_recorder widget to record audio
40
+ audio_bytes = audio_recorder(sample_rate=16000, codec="wav", show_playback_controls=True)
41
 
42
  # Display the recorded audio
43
  if audio_bytes: