10000 Sending audio to Tavus using custom tracks by filipi87 · Pull Request #1950 · pipecat-ai/pipecat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Sending audio to Tavus using custom tracks #1950

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 10000 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

filipi87
Copy link
Contributor
@filipi87 filipi87 commented Jun 3, 2025

This PR adds support for sending audio to Tavus using custom tracks instead of app messages.

It also includes a test script (scripts/test_tavus_transport.py) that mimics the behavior expected to be supported by Tavus.

Copy link
codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 0% with 44 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pipecat/transports/services/tavus.py 0.00% 27 Missing ⚠️
src/pipecat/services/tavus/video.py 0.00% 17 Missing ⚠️
Files with missing lines Coverage Δ
src/pipecat/services/tavus/video.py 0.00% <0.00%> (ø)
src/pipecat/transports/services/tavus.py 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@filipi87 filipi87 changed the title Filipi/tavus custom tracks Sending audio to Tavus using custom tracks Jun 3, 2025
@filipi87 filipi87 force-pushed the filipi/tavus_custom_tracks branch from 8de4d1a to 9f4fed2 Compare June 3, 2025 19:08
@filipi87 filipi87 marked this pull request as ready for review June 3, 2025 19:24
@filipi87 filipi87 requested review from aconchillo and markbackman and removed request for aconchillo June 3, 2025 19:24
@aconchillo
Copy link
Contributor

Nice cleanup! Added some comments.

@filipi87 filipi87 requested a review from aconchillo June 10, 2025 15:30
- `TavusTransport` and `TavusVideoService` now send audio to Tavus using WebRTC
audio tracks instead of `app-messages` over WebSocket. This should improve the
overall audio quality.
-
Copy link
Contributor

Choose a reason for hiding this comment

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

This probably needs a rebase.

@@ -58,7 +54,7 @@ def __init__(
*,
api_key: str,
replica_id: str,
persona_id: str = "pipecat0", # Use `pipecat0` so that your TTS voice is used in place of the Tavus persona
persona_id: str = "pipecat-stream",
Copy link
Contributor

Choose a reason for hiding this comment

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

The docstring above needs to be updated with pipecat-stream

@@ -133,15 +142,14 @@ def __init__(
callbacks: TavusCallbacks,
api_key: str,
replica_id: str,
persona_id: str = "pipecat0", # Use `pipecat0` so that your TTS voice is used in place of the Tavus persona
persona_id: str = "pipecat-stream",
Copy link
Contributor

Choose a reason for hiding this comment

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

The docstring above needs to mention pipecat-stream

@aconchillo
Copy link
Contributor

LGTM. Just 3 minor comments about CHANGELOG and docstrings. Nice work! 🙌

@@ -767,6 +767,7 @@ async def add_custom_audio_track(self, track_name: str) -> DailyAudioTrack:
self._client.add_custom_audio_track(
track_name=track_name,
audio_track=audio_track,
ignore_audio_level=True,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is preventing the SFU to use the custom audio tracker to trigger the active speaker event.

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
0