vakodiya commited on
Commit
c68e0fd
1 Parent(s): 8bf3f02

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -5,11 +5,19 @@ import io
5
  import wave
6
  import requests
7
  from audio_to_text import audio_to_text
8
-
9
 
10
  # Initialize Streamlit app layout
11
  st.title("Microphone Input in Streamlit")
12
 
 
 
 
 
 
 
 
 
13
  def audio_callback(frame):
14
  # Get raw audio data from the frame
15
  audio_data = frame.to_ndarray().astype(np.int16)
 
5
  import wave
6
  import requests
7
  from audio_to_text import audio_to_text
8
+ import streamlit.components.v1 as components
9
 
10
  # Initialize Streamlit app layout
11
  st.title("Microphone Input in Streamlit")
12
 
13
+ # Load the custom component
14
+ mic_component = """
15
+ <button>Record Audio</button>
16
+ <script src="mic_component.js"></script>
17
+ """
18
+
19
+ components.html(mic_component)
20
+
21
  def audio_callback(frame):
22
  # Get raw audio data from the frame
23
  audio_data = frame.to_ndarray().astype(np.int16)