chatcraft.org
chatcraft.org copied to clipboard
Add a stop announcing button for TTS
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:
- 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. - 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.
- It also has a tooltip suggesting that "ChatCraft is Speaking" and clicking it would stop the current announcement.
- It works with both real time streaming and Speak option.
I could probably position this better. Might need some help in figuring out.
This fixes #521