Akis Giannoukos commited on
Commit
1cbe806
·
1 Parent(s): 8526485

Enhance demo interface by hiding TTS player UI with CSS while maintaining functionality for autoplay

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -598,6 +598,8 @@ def create_demo():
598
  70% { transform: scale(1.06); box-shadow: 0 0 0 20px rgba(239,68,68,0.0); }
599
  100% { transform: scale(1.0); box-shadow: 0 0 0 0 rgba(239,68,68,0.0); }
600
  }
 
 
601
  '''
602
  ) as demo:
603
  gr.Markdown(
@@ -615,8 +617,8 @@ def create_demo():
615
  audio_main = gr.Microphone(type="filepath", label=None, elem_id="voice-bubble", show_label=False)
616
  # Hidden text input placeholder for pipeline compatibility
617
  text_main = gr.Textbox(value="", visible=False)
618
- # Autoplay clinician voice output (hidden player)
619
- tts_audio_main = gr.Audio(label=None, interactive=False, autoplay=True, show_label=False, visible=False)
620
 
621
  with gr.TabItem("Chat"):
622
  with gr.Column():
 
598
  70% { transform: scale(1.06); box-shadow: 0 0 0 20px rgba(239,68,68,0.0); }
599
  100% { transform: scale(1.0); box-shadow: 0 0 0 0 rgba(239,68,68,0.0); }
600
  }
601
+ /* Hide TTS player UI but keep it in DOM for autoplay */
602
+ #tts-player { width: 0 !important; height: 0 !important; opacity: 0 !important; position: absolute; pointer-events: none; }
603
  '''
604
  ) as demo:
605
  gr.Markdown(
 
617
  audio_main = gr.Microphone(type="filepath", label=None, elem_id="voice-bubble", show_label=False)
618
  # Hidden text input placeholder for pipeline compatibility
619
  text_main = gr.Textbox(value="", visible=False)
620
+ # Autoplay clinician voice output (player hidden with CSS)
621
+ tts_audio_main = gr.Audio(label=None, interactive=False, autoplay=True, show_label=False, elem_id="tts-player")
622
 
623
  with gr.TabItem("Chat"):
624
  with gr.Column():