chatcraft.org icon indicating copy to clipboard operation
chatcraft.org copied to clipboard

Add a stop announcing button for TTS

Open Amnish04 opened this issue 9 months ago • 10 comments

I've been thinking for a long time to have a dedicated control that can stop text to speech announcements for a particular message, instead of having to disable and enable TTS setting that is persisted in local storage.

In this PR:

  1. I have added a DisableAudioPlayerButton component that normally stays off screen but appears when ChatCraft is streaming any audio in top left part of view port. I chose fixed positioning as I couldn't find enough real estate in the page where it could fit while being easily visible.
  2. It works by clearing any audio clips in the audio queue and temporarily disabling it so no new audio clips are added as the response gets generated. The queue is automatically enabled once the message has finished streaming.
  3. It also has a tooltip suggesting that "ChatCraft is Speaking" and clicking it would stop the current announcement.
  4. It works with both real time streaming and Speak option.

StopAnnouncementButton

I could probably position this better. Might need some help in figuring out.

This fixes #521

Amnish04 avatar Jun 03 '24 00:06 Amnish04