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

Support Multisegments for TTS input #1288

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Support Multisegments for TTS input #1288

wants to merge 12 commits into from

Conversation

jayeshp19
Copy link
Collaborator

This PR implements support for multiple segments in tts input

Copy link

changeset-bot bot commented Dec 23, 2024

🦋 Changeset detected

Latest commit: 95a6fbe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
livekit-plugins-assemblyai Patch
livekit-plugins-elevenlabs Patch
livekit-plugins-cartesia Patch
livekit-plugins-deepgram Patch
livekit-plugins-google Patch
livekit-plugins-openai Patch
livekit-plugins-playai Patch
livekit-plugins-azure Patch
livekit-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jayeshp19 jayeshp19 changed the title Support Multisegments for TTS input [draft] Support Multisegments for TTS input Dec 23, 2024
@utils.log_exceptions(logger=logger)
async def _run_segments():
async for input_stream in self._segments_ch:
await self._run(input_stream)
Copy link
Member

Choose a reason for hiding this comment

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

This will not reuse the existing connection? (I know Cartesia supports having multiple segments without disconnecting, 11labs may too but I'm not sure)

Copy link
Collaborator Author

@jayeshp19 jayeshp19 Dec 25, 2024

Choose a reason for hiding this comment

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

I don't think 11labs supports it, I've updated code for rest of plugins to reuse ws connection

@jayeshp19 jayeshp19 closed this Dec 25, 2024
@jayeshp19 jayeshp19 deleted the multisegments-tts branch December 25, 2024 19:09
@jayeshp19 jayeshp19 restored the multisegments-tts branch December 25, 2024 19:10
@jayeshp19 jayeshp19 reopened this Dec 25, 2024
@jayeshp19 jayeshp19 changed the title [draft] Support Multisegments for TTS input Support Multisegments for TTS input Dec 25, 2024
@jayeshp19 jayeshp19 requested a review from theomonnom December 25, 2024 21:30
@jayeshp19 jayeshp19 marked this pull request as ready for review December 25, 2024 21:31
stream.end_input()
stream.flush()
if i == 1:
stream.end_input()

frames = []
is_final = False
Copy link
Member

Choose a reason for hiding this comment

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

each segment should have its own is_final

@jayeshp19 jayeshp19 requested a review from theomonnom January 20, 2025 11:54
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.

2 participants