Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

services: fix some TTS websocket service interruption handling #1272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aconchillo
Copy link
Contributor

@aconchillo aconchillo commented Feb 21, 2025

Please describe the changes in your PR. If it is addressing an issue, please reference that as well.

@markbackman We already talked about this before. People are really hitting this issue, so even if not nice we need to support all TTS services as good as we can.

I did an optimization though. If the bot is not speaking and the user talks, we don't reconnect. We only reconnect if it's a real interruption.

Fixes #1258

Copy link

codecov bot commented Feb 21, 2025

@aconchillo aconchillo force-pushed the aleix/tts-websocket-interruptions branch 3 times, most recently from e26c413 to 38019f5 Compare February 22, 2025 01:35
@aconchillo aconchillo force-pushed the aleix/tts-websocket-interruptions branch from 38019f5 to 94ee664 Compare February 22, 2025 01:49
@@ -434,6 +436,12 @@ async def _stop_frame_handler(self):


class WordTTSService(TTSService):
"""This a base class for TTS services that support word timestamps. Word
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""This a base class for TTS services that support word timestamps. Word
"""This is a base class for TTS services that support word timestamps. Word

this to work, the TTS service needs to support handling multiple requests at
once (i.e. multiple simultaneous contexts).
class WebsocketTTSService(TTSService, WebsocketService):
"""This a base class for websocket-based TTS services."""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""This a base class for websocket-based TTS services."""
"""This is a base class for websocket-based TTS services."""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same typo in other docstrings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent should send interrupt on push_aggregation or EmulateUserStartedSpeakingFrame ?
2 participants