MayankGupta06 commited on
Commit
3d65dc9
·
verified ·
1 Parent(s): 213818c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -14
app.py CHANGED
@@ -539,23 +539,23 @@ def get_user_location():
539
  if option == "Home":
540
  user_question = st.text_input("Type your symptoms or disease name:")
541
 
542
- st.title("🎤 AI Health Assistant - Speech to Text")
543
 
544
- uploaded_file = st.file_uploader("Upload an audio file (.wav)", type=["wav"])
545
 
546
- if uploaded_file:
547
- recognizer = sr.Recognizer()
548
- with sr.AudioFile(uploaded_file) as source:
549
- st.info("Processing audio...")
550
- audio = recognizer.record(source)
551
 
552
- try:
553
- text = recognizer.recognize_google(audio)
554
- st.success(f"Recognized Text: {text}")
555
- except sr.UnknownValueError:
556
- st.error("Could not understand the audio")
557
- except sr.RequestError:
558
- st.error("Error with the speech recognition service")
559
 
560
  # lang = st.selectbox("Select Language", ["English", "Hindi", "Spanish"])
561
  # if lang != "English":
 
539
  if option == "Home":
540
  user_question = st.text_input("Type your symptoms or disease name:")
541
 
542
+ # st.title("🎤 AI Health Assistant - Speech to Text")
543
 
544
+ # uploaded_file = st.file_uploader("Upload an audio file (.wav)", type=["wav"])
545
 
546
+ # if uploaded_file:
547
+ # recognizer = sr.Recognizer()
548
+ # with sr.AudioFile(uploaded_file) as source:
549
+ # st.info("Processing audio...")
550
+ # audio = recognizer.record(source)
551
 
552
+ # try:
553
+ # text = recognizer.recognize_google(audio)
554
+ # st.success(f"Recognized Text: {text}")
555
+ # except sr.UnknownValueError:
556
+ # st.error("Could not understand the audio")
557
+ # except sr.RequestError:
558
+ # st.error("Error with the speech recognition service")
559
 
560
  # lang = st.selectbox("Select Language", ["English", "Hindi", "Spanish"])
561
  # if lang != "English":